1
0
mirror of https://salsa.debian.org/games-team/bsdgames synced 2024-12-04 14:46:22 -05:00

Handle requested action in maintainer scripts.

This commit is contained in:
Ben Finney 2016-02-25 14:12:35 +11:00 committed by Dr. Tobias Quathamer
parent ae3c9d2986
commit 9552326695
4 changed files with 57 additions and 0 deletions

15
debian/postinst vendored
View File

@ -16,6 +16,8 @@ set -e
# For details, see <URL:http://www.debian.org/doc/debian-policy/> or
# the debian-policy package.
action="$1"
SCOREFILES="
/var/games/bsdgames/atc_score
/var/games/bsdgames/battlestar.log
@ -69,6 +71,19 @@ chmod 664 $SCOREFILES
# in them.
chmod 660 /var/games/bsdgames/phantasia/characs
case "$action" in
configure|abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
printf "postinst called with unknown action %s\n" "$action" >&2
exit 1
;;
esac
# I have to make this directory here, because older version of this package
# always deleted it in their postrm. Oops.
mkdir -p /var/games/bsdgames/sail

14
debian/postrm vendored
View File

@ -17,6 +17,8 @@ set -e
# For details, see <URL:http://www.debian.org/doc/debian-policy/> or
# the debian-policy package.
action="$1"
SCOREFILES="
/var/games/bsdgames/atc_score
/var/games/bsdgames/battlestar.log
@ -47,4 +49,16 @@ if [ "$1" = "purge" ]; then
rmdir -p /var/games/bsdgames/hack/save 2>/dev/null || true
fi
case "$action" in
remove|purge|upgrade|disappear|failed-upgrade|abort-install|abort-upgrade)
;;
*)
printf "postrm called with unknown action %s\n" "$action" >&2
exit 1
;;
esac
#DEBHELPER#

15
debian/preinst vendored
View File

@ -13,6 +13,8 @@ set -e
# For details, see the Debian Policy §6.5 in the debian-policy package
# or on the web at <URL:http://www.debian.org/doc/debian-policy/>.
action="$1"
SCOREFILES="
/var/games/bsdgames/atc_score
/var/games/bsdgames/battlestar.log
@ -58,6 +60,19 @@ if [ -d /var/lib/games ]; then
rm -rf /var/lib/games/bsdgames
fi
case "$action" in
install|upgrade|abort-upgrade)
;;
*)
printf "preinst called with unknown action %s\n" "$action" >&2
exit 1
;;
esac
# I didn't move robots_roll above, because the version used by old bsdgames has
# a different file format. Make sure that if I'm ugrading from pre 2.8 days,
# the old file is deleted.

13
debian/prerm vendored
View File

@ -17,6 +17,19 @@ set -e
# For details, see <URL:http://www.debian.org/doc/debian-policy/> or
# the debian-policy package.
action="$1"
case "$action" in
remove|deconfigure|upgrade|failed-upgrade)
;;
*)
printf "prerm called with unknown action %s\n" "$action" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.