#! /bin/sh # -*- Mode: Sh -*- # postinst --- # Author : Manoj Srivastava ( srivasta@glaurung.green-gryphon.com ) # Created On : Fri Nov 14 11:25:07 2003 # Created On Node : glaurung.green-gryphon.com # Last Modified By : Chris Carr # Last Modified On : Sat Jan 15 23:25:41 2015 # Last Machine Used: cc.sadnet # Update Count : 18 # Status : Unknown, Use with caution! # HISTORY : # Description : # # arch-tag: 5401e9ef-39cc-4aee-96a4-61dfb8f32cf7 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Automatically added by dh_installdeb/13.11.6 dpkg-maintscript-helper rm_conffile /etc/angband/pref/graf-mac.prf 1:4.2.5\+dfsg-1\~ angband -- "$@" dpkg-maintscript-helper rm_conffile /etc/angband/pref/graf-win.prf 1:4.2.5\+dfsg-1\~ angband -- "$@" dpkg-maintscript-helper rm_conffile /etc/angband/pref/graf-sdl.prf 1:4.2.5\+dfsg-1\~ angband -- "$@" dpkg-maintscript-helper rm_conffile /etc/angband/pref/graf-gtk.prf 1:4.2.5\+dfsg-1\~ angband -- "$@" dpkg-maintscript-helper rm_conffile /etc/angband/pref/graf-x11.prf 1:4.2.5\+dfsg-1\~ angband -- "$@" dpkg-maintscript-helper rm_conffile /etc/angband/pref/pref-x11.prf 1:4.2.5\+dfsg-1\~ angband -- "$@" dpkg-maintscript-helper rm_conffile /etc/angband/pref/pref-win.prf 1:4.2.5\+dfsg-1\~ angband -- "$@" dpkg-maintscript-helper rm_conffile /etc/angband/pref/pref-gcu.prf 1:4.2.5\+dfsg-1\~ angband -- "$@" dpkg-maintscript-helper rm_conffile /etc/angband/pref/pref-sdl.prf 1:4.2.5\+dfsg-1\~ angband -- "$@" dpkg-maintscript-helper rm_conffile /etc/angband/pref/pref-mac.prf 1:4.2.5\+dfsg-1\~ angband -- "$@" dpkg-maintscript-helper rm_conffile /etc/angband/pref/pref-acn.prf 1:4.2.5\+dfsg-1\~ angband -- "$@" dpkg-maintscript-helper rm_conffile /etc/angband/pref/user-mac.prf 1:4.2.5\+dfsg-1\~ angband -- "$@" dpkg-maintscript-helper rm_conffile /etc/angband/pref/font-gtk.prf 1:4.2.5\+dfsg-1\~ angband -- "$@" dpkg-maintscript-helper rm_conffile /etc/angband/pref/font-mac.prf 1:4.2.5\+dfsg-1\~ angband -- "$@" dpkg-maintscript-helper rm_conffile /etc/angband/edit/shop-own.txt 1:4.2.5\+dfsg-1\~ angband -- "$@" # End automatically added section set -e case "$1" in configure) # clean up old cruft if [ -d /var/lib/games/angband/save ]; then for file in $(find /var/lib/games/angband/save/ -type f); do if [ ! -f $file ]; then continue; fi base=$(basename $file) if [ "X$base" = "Xdelete.me" ]; then continue; fi if [ -s /var/games/angband/save/$base ]; then mv -f $file /var/games/angband/save/$base.old else mv -f $file /var/games/angband/save/$base fi done fi if [ -d /var/lib/games/angband ]; then rm -rf /var/lib/games/angband fi # clean out old conf files which are now in /usr/share/angband if [ -d /etc/angband/help ]; then rm -rf /etc/angband/help fi if [ -d /etc/angband/file ]; then rm -rf /etc/angband/file fi # preserve the following from previous versions for manual cleanup: # - any pref files in /var/games/angband/user # - any spoiler files in /var/games/angband/info for dir in user info; do if [ -e /var/games/angband/$dir/delete.me ]; then rm -f /var/games/angband/$dir/delete.me fi if [ -d /var/games/angband/$dir ]; then rmdir --ignore-fail-on-non-empty /var/games/angband/$dir fi done for dir in bone data xtra; do if [ -d /var/games/angband/$dir ]; then rm -rf /var/games/angband/$dir fi done for link in edit file help pref; do if [ -L /var/games/angband/$link ]; then rm /var/games/angband/$link fi done # Set correct permissions for exe, score and save dirs chown root:games /usr/games/angband chmod 2755 /usr/games/angband chown root:games /var/games/angband/apex chmod 2775 /var/games/angband/apex chown root:games /var/games/angband/panic chmod 2775 /var/games/angband/panic chown root:games /var/games/angband/save chmod 2775 /var/games/angband/save chown root:games /var/games/angband/scores chmod 2775 /var/games/angband/scores ;; abort-upgrade) # Back out of an attempt to upgrade this package FROM THIS VERSION # to version $2. Undo the effects of "prerm upgrade $2". : ;; abort-remove) if test "$2" != in-favour; then echo "$0: undocumented call to \`postinst $*'" 1>&2 exit 0 fi # Back out of an attempt to remove this package, which was due to # a conflict with package $3 (version $4). Undo the effects of # "prerm remove in-favour $3 $4". : ;; abort-deconfigure) if test "$2" != in-favour || test "$5" != removing; then echo "$0: undocumented call to \`postinst $*'" 1>&2 exit 0 fi # Back out of an attempt to deconfigure this package, which was # due to package $6 (version $7) which we depend on being removed # to make way for package $3 (version $4). Undo the effects of # "prerm deconfigure in-favour $3 $4 removing $6 $7". : ;; *) echo "$0: didn't understand being called with \`$1'" 1>&2 exit 0;; esac