#!/bin/sh -e set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package # PROG=/usr/games/gravitywars SCOREFILE=/var/games/gravitywars/hscore.gw case "$1" in configure) # Cancel my old stupid use of dpkg-statoverride if [ "$1" = "configure" ] && [ "$2" != "" ] && dpkg --compare-versions "$2" le "1.102-28" && dpkg-statoverride --list "$PROG" >/dev/null then dpkg-statoverride --remove "$PROG" fi # Properly use statoverride if ! dpkg-statoverride --list "$PROG" >/dev/null ; then chown root:games "$PROG" chmod 2755 "$PROG" fi # Move from old pre-FHS location if present. if [ -e /var/lib/games/gravitywars/hscore.gw ]; then mv -f /var/lib/games/gravitywars/hscore.gw $SCOREFILE rmdir -p /var/lib/games/gravitywars 2>/dev/null || true fi if [ ! -e "$SCOREFILE" ]; then touch "$SCOREFILE" fi # Make sure the file has the right permissions chown root:games $SCOREFILE chmod 664 $SCOREFILE ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac