[bsdgames] 03/10: Handle requested action in maintainer scripts.

Tobias Quathamer toddy at moszumanska.debian.org
Tue Apr 5 09:18:57 UTC 2016


This is an automated email from the git hooks/post-receive script.

toddy pushed a commit to branch master
in repository bsdgames.

commit 9552326695a9868e6fe4ec24e4ea277a65c46525
Author: Ben Finney <ben+debian at benfinney.id.au>
Date:   Thu Feb 25 14:12:35 2016 +1100

    Handle requested action in maintainer scripts.
---
 debian/postinst | 15 +++++++++++++++
 debian/postrm   | 14 ++++++++++++++
 debian/preinst  | 15 +++++++++++++++
 debian/prerm    | 13 +++++++++++++
 4 files changed, 57 insertions(+)

diff --git a/debian/postinst b/debian/postinst
index 5f69272..a89399d 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -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
diff --git a/debian/postrm b/debian/postrm
index 22395c5..1ce6f84 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -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#
diff --git a/debian/preinst b/debian/preinst
index 295955d..3890afd 100644
--- a/debian/preinst
+++ b/debian/preinst
@@ -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.
diff --git a/debian/prerm b/debian/prerm
index f18f168..2fb0e11 100644
--- a/debian/prerm
+++ b/debian/prerm
@@ -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.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/bsdgames.git



More information about the Pkg-games-commits mailing list