From 19a74bfe834dc64483db6b58386ad9e15d9ed051 Mon Sep 17 00:00:00 2001 From: Ben Finney Date: Thu, 25 Feb 2016 14:22:33 +1100 Subject: [PATCH] =?UTF-8?q?Use=20maintainer=20scripts=20to=20set=20?= =?UTF-8?q?=E2=80=98adventure=E2=80=99=20Debian=20alternatives.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 2 ++ debian/postinst | 13 ++++++++++++- debian/prerm | 7 ++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9322547..96c9257 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ bsdgames (2.17-24) UNRELEASED; urgency=medium * adventure: - Declare “Provides: adventure” as this is one possible implementation of the Colossal Cave Adventure. + - Use Debian alternatives system to present ‘bsdgames-adventure’ as an + implementation of ‘adventure’. -- diff --git a/debian/postinst b/debian/postinst index 60cf0b5..84cc7cf 100644 --- a/debian/postinst +++ b/debian/postinst @@ -71,9 +71,20 @@ chmod 664 $SCOREFILES # in them. chmod 660 /var/games/bsdgames/phantasia/characs +ADVENTURE_PRIORITY=50 + case "$action" in - configure|abort-upgrade|abort-remove|abort-deconfigure) + configure) + update-alternatives --install \ + /usr/games/adventure adventure \ + /usr/games/bsdgames-adventure $ADVENTURE_PRIORITY \ + --slave \ + /usr/share/man/man6/adventure.6.gz adventure.6.gz \ + /usr/share/man/man6/bsdgames-adventure.6.gz + ;; + + abort-upgrade|abort-remove|abort-deconfigure) ;; *) diff --git a/debian/prerm b/debian/prerm index e2ae4c7..b0abe74 100644 --- a/debian/prerm +++ b/debian/prerm @@ -21,7 +21,12 @@ action="$1" case "$action" in - remove|deconfigure|upgrade|failed-upgrade) + remove|deconfigure) + update-alternatives --remove \ + adventure /usr/games/bsdgames-adventure + ;; + + upgrade|failed-upgrade) ;; *)