Bug#659792: stella: use dh_installdeb maintscript support
Colin Watson
cjwatson at ubuntu.com
Mon Feb 13 18:44:25 UTC 2012
Package: stella
Version: 3.5-1
Severity: wishlist
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch precise
Using 'dpkg-maintscript-helper supports rm_conffile' guards introduces
unreliability into upgrades; it means that the conffile is removed or
not depending on whether dpkg happens to be unpacked before stella.
This seems generally undesirable; it would be better to enforce a single
code path. (This is academic for Debian because the version of dpkg in
squeeze supported dpkg-maintscript-helper, hence Severity: wishlist;
Ubuntu's last LTS release didn't have a sufficient version of dpkg for
that which is why I care.)
It would be nice to just use dh_installdeb's support for generating
dpkg-maintscript-helper commands, which was introduced in debhelper
8.1.0. This would remove duplicate code from your maintainer scripts -
in fact, you'd no longer need to have handwritten maintainer scripts at
all. Here's a patch:
* Use maintscript support in dh_installdeb rather than writing out
dpkg-maintscript-helper commands by hand. We now simply Pre-Depend on a
new enough version of dpkg rather than using 'dpkg-maintscript-helper
supports' guards, leading to more predictable behaviour on upgrades.
diff -Nru stella-3.5/debian/control stella-3.5/debian/control
--- stella-3.5/debian/control 2011-12-29 22:45:07.000000000 +0000
+++ stella-3.5/debian/control 2012-02-13 18:42:55.000000000 +0000
@@ -5,13 +5,14 @@
Uploaders: Stephen Kitt <steve at sk2.org>
DM-Upload-Allowed: yes
Standards-Version: 3.9.2
-Build-Depends: debhelper (>= 7.0.50), libsdl1.2-dev, zlib1g-dev, libpng12-dev, autotools-dev
+Build-Depends: debhelper (>= 8.1.0~), libsdl1.2-dev, zlib1g-dev, libpng12-dev, autotools-dev
Homepage: http://stella.sf.net
Vcs-Git: git://git.debian.org/git/pkg-games/stella.git
Vcs-Browser: http://git.debian.org/?p=pkg-games/stella.git
Package: stella
Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Atari 2600 Emulator for SDL & the X Window System
Stella is a portable emulator of the old Atari 2600 video-game
diff -Nru stella-3.5/debian/maintscript stella-3.5/debian/maintscript
--- stella-3.5/debian/maintscript 1970-01-01 01:00:00.000000000 +0100
+++ stella-3.5/debian/maintscript 2012-02-13 18:41:45.000000000 +0000
@@ -0,0 +1 @@
+rm_conffile /etc/stella.pro 3.2-1
diff -Nru stella-3.5/debian/postinst stella-3.5/debian/postinst
--- stella-3.5/debian/postinst 2011-06-15 22:48:02.000000000 +0100
+++ stella-3.5/debian/postinst 1970-01-01 01:00:00.000000000 +0100
@@ -1,43 +0,0 @@
-#!/bin/sh
-# postinst script for stella
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-# * <postinst> `configure' <most-recently-configured-version>
-# * <old-postinst> `abort-upgrade' <new version>
-# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
-# <new-version>
-# * <postinst> `abort-remove'
-# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
-# <failed-install-package> <version> `removing'
-# <conflicting-package> <version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-if dpkg-maintscript-helper supports rm_conffile; then
- dpkg-maintscript-helper rm_conffile /etc/stella.pro 3.2-1 stella -- "$@"
-fi
-
-case "$1" in
- configure)
- ;;
-
- abort-upgrade|abort-remove|abort-deconfigure)
- ;;
-
- *)
- echo "postinst called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
diff -Nru stella-3.5/debian/postrm stella-3.5/debian/postrm
--- stella-3.5/debian/postrm 2011-06-15 22:48:02.000000000 +0100
+++ stella-3.5/debian/postrm 1970-01-01 01:00:00.000000000 +0100
@@ -1,41 +0,0 @@
-#!/bin/sh
-# postrm script for stella
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-# * <postrm> `remove'
-# * <postrm> `purge'
-# * <old-postrm> `upgrade' <new-version>
-# * <new-postrm> `failed-upgrade' <old-version>
-# * <new-postrm> `abort-install'
-# * <new-postrm> `abort-install' <old-version>
-# * <new-postrm> `abort-upgrade' <old-version>
-# * <disappearer's-postrm> `disappear' <overwriter>
-# <overwriter-version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-if dpkg-maintscript-helper supports rm_conffile; then
- dpkg-maintscript-helper rm_conffile /etc/stella.pro 3.2-1 stella -- "$@"
-fi
-
-case "$1" in
- purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
- ;;
-
- *)
- echo "postrm called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
diff -Nru stella-3.5/debian/preinst stella-3.5/debian/preinst
--- stella-3.5/debian/preinst 2011-06-15 22:48:02.000000000 +0100
+++ stella-3.5/debian/preinst 1970-01-01 01:00:00.000000000 +0100
@@ -1,39 +0,0 @@
-#!/bin/sh
-# preinst script for stella
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-# * <new-preinst> `install'
-# * <new-preinst> `install' <old-version>
-# * <new-preinst> `upgrade' <old-version>
-# * <old-preinst> `abort-upgrade' <new-version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-if dpkg-maintscript-helper supports rm_conffile; then
- dpkg-maintscript-helper rm_conffile /etc/stella.pro 3.2-1 stella -- "$@"
-fi
-
-case "$1" in
- install|upgrade)
- ;;
-
- abort-upgrade)
- ;;
-
- *)
- echo "preinst called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
Thanks,
--
Colin Watson [cjwatson at ubuntu.com]
More information about the Pkg-games-devel
mailing list