| 1 |
#! /bin/sh |
| 2 |
|
| 3 |
#DEBHELPER# |
| 4 |
|
| 5 |
set -e |
| 6 |
|
| 7 |
case "$1" in |
| 8 |
configure) |
| 9 |
# clean out old conf files which are now in /usr/share/angband |
| 10 |
if [ -d /etc/angband/help ]; then |
| 11 |
rm -rf /etc/angband/help |
| 12 |
fi |
| 13 |
|
| 14 |
if [ -d /etc/angband/file ]; then |
| 15 |
rm -rf /etc/angband/file |
| 16 |
fi |
| 17 |
|
| 18 |
# preserve the following from previous versions for manual cleanup: |
| 19 |
# - any pref files in /var/games/angband/user |
| 20 |
# - any spoiler files in /var/games/angband/info |
| 21 |
for dir in user info; do |
| 22 |
if [ -e /var/games/angband/$dir/delete.me ]; then |
| 23 |
rm -f /var/games/angband/$dir/delete.me |
| 24 |
fi |
| 25 |
|
| 26 |
if [ -d /var/games/angband/$dir ]; then |
| 27 |
rmdir --ignore-fail-on-non-empty /var/games/angband/$dir |
| 28 |
fi |
| 29 |
done |
| 30 |
|
| 31 |
for dir in bone data xtra; do |
| 32 |
if [ -d /var/games/angband/$dir ]; then |
| 33 |
rm -rf /var/games/angband/$dir |
| 34 |
fi |
| 35 |
done |
| 36 |
|
| 37 |
for link in edit file help pref; do |
| 38 |
if [ -L /var/games/angband/$link ]; then |
| 39 |
rm /var/games/angband/$link |
| 40 |
fi |
| 41 |
done |
| 42 |
|
| 43 |
# Set correct permissions for exe, score and save dirs |
| 44 |
# -> this is moved to d/angband.tmpfiles |
| 45 |
;; |
| 46 |
abort-upgrade) |
| 47 |
# Back out of an attempt to upgrade this package FROM THIS VERSION |
| 48 |
# to version $2. Undo the effects of "prerm upgrade $2". |
| 49 |
: |
| 50 |
|
| 51 |
;; |
| 52 |
abort-remove) |
| 53 |
if test "$2" != in-favour; then |
| 54 |
echo "$0: undocumented call to \`postinst $*'" 1>&2 |
| 55 |
exit 0 |
| 56 |
fi |
| 57 |
# Back out of an attempt to remove this package, which was due to |
| 58 |
# a conflict with package $3 (version $4). Undo the effects of |
| 59 |
# "prerm remove in-favour $3 $4". |
| 60 |
: |
| 61 |
|
| 62 |
;; |
| 63 |
abort-deconfigure) |
| 64 |
if test "$2" != in-favour || test "$5" != removing; then |
| 65 |
echo "$0: undocumented call to \`postinst $*'" 1>&2 |
| 66 |
exit 0 |
| 67 |
fi |
| 68 |
# Back out of an attempt to deconfigure this package, which was |
| 69 |
# due to package $6 (version $7) which we depend on being removed |
| 70 |
# to make way for package $3 (version $4). Undo the effects of |
| 71 |
# "prerm deconfigure in-favour $3 $4 removing $6 $7". |
| 72 |
: |
| 73 |
|
| 74 |
;; |
| 75 |
*) echo "$0: didn't understand being called with \`$1'" 1>&2 |
| 76 |
exit 0;; |
| 77 |
esac |