Package: fookebox
Version: 0.6.0-1
Severity: wishlist
Tags: patch
User: ubuntu-de...@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 fookebox.
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.
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 fookebox-0.6.0/debian/control fookebox-0.6.0/debian/control
--- fookebox-0.6.0/debian/control       2011-05-03 19:45:44.000000000 +0100
+++ fookebox-0.6.0/debian/control       2012-02-13 15:27:46.000000000 +0000
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Stefan Ott <ste...@ott.net>
 Uploaders: Python Applications Packaging Team 
<python-apps-t...@lists.alioth.debian.org>
-Build-Depends: debhelper (>= 7.0.50), python, python-setuptools, 
python-pastescript
+Build-Depends: debhelper (>= 8.1.0~), python, python-setuptools, 
python-pastescript
 Standards-Version: 3.9.2
 Homepage: http://fookebox.googlecode.com/
 Vcs-Svn: svn://svn.debian.org/python-apps/packages/fookebox/trunk
@@ -11,6 +11,7 @@
 
 Package: fookebox
 Architecture: all
+Pre-Depends: ${misc:Pre-Depends}
 Depends: ${misc:Depends}, ${python:Depends}, libjs-prototype, 
libjs-scriptaculous, python-pylons, python-mpd, python-simplejson, 
python-sqlalchemy, libapache2-mod-wsgi | httpd-wsgi
 Recommends: mpd
 Description: web-based jukebox frontend to mpd
diff -Nru fookebox-0.6.0/debian/maintscript fookebox-0.6.0/debian/maintscript
--- fookebox-0.6.0/debian/maintscript   1970-01-01 01:00:00.000000000 +0100
+++ fookebox-0.6.0/debian/maintscript   2012-02-13 15:26:45.000000000 +0000
@@ -0,0 +1,2 @@
+rm_conffile /etc/fookebox/site.conf.php 0.4.99-1
+rm_conffile /etc/fookebox/status.conf.php 0.4.99-1
diff -Nru fookebox-0.6.0/debian/postinst fookebox-0.6.0/debian/postinst
--- fookebox-0.6.0/debian/postinst      2011-05-08 09:58:40.000000000 +0100
+++ fookebox-0.6.0/debian/postinst      2012-02-13 15:27:05.000000000 +0000
@@ -32,14 +32,6 @@
        ;;
 esac
 
-# handle updates from older package versions
-if dpkg-maintscript-helper supports rm_conffile ; then
-       dpkg-maintscript-helper rm_conffile \
-               /etc/fookebox/site.conf.php 0.4.99-1 -- "$@"
-       dpkg-maintscript-helper rm_conffile \
-               /etc/fookebox/status.conf.php 0.4.99-1 -- "$@"
-fi
-
 #DEBHELPER#
 
 exit 0
diff -Nru fookebox-0.6.0/debian/postrm fookebox-0.6.0/debian/postrm
--- fookebox-0.6.0/debian/postrm        2010-07-22 19:16:42.000000000 +0100
+++ fookebox-0.6.0/debian/postrm        2012-02-13 15:27:08.000000000 +0000
@@ -3,14 +3,6 @@
 
 set -e
 
-# handle updates from older package versions
-if dpkg-maintscript-helper supports rm_conffile ; then
-       dpkg-maintscript-helper rm_conffile \
-               /etc/fookebox/site.conf.php 0.4.99-1 -- "$@"
-       dpkg-maintscript-helper rm_conffile \
-               /etc/fookebox/status.conf.php 0.4.99-1 -- "$@"
-fi
-
 # Remove database if package is being purged
 if [ "$1" = "purge" ] ; then
        rm -f /var/lib/fookebox/fookebox.sqlite
diff -Nru fookebox-0.6.0/debian/preinst fookebox-0.6.0/debian/preinst
--- fookebox-0.6.0/debian/preinst       2010-07-22 19:16:42.000000000 +0100
+++ fookebox-0.6.0/debian/preinst       2012-02-13 15:27:11.000000000 +0000
@@ -11,14 +11,6 @@
        ;;
 esac
 
-# handle updates from older package versions
-if dpkg-maintscript-helper supports rm_conffile ; then
-       dpkg-maintscript-helper rm_conffile \
-               /etc/fookebox/site.conf.php 0.4.99-1 -- "$@"
-       dpkg-maintscript-helper rm_conffile \
-               /etc/fookebox/status.conf.php 0.4.99-1 -- "$@"
-fi
-
 #DEBHELPER#
 
 exit 0
diff -Nru fookebox-0.6.0/debian/prerm fookebox-0.6.0/debian/prerm
--- fookebox-0.6.0/debian/prerm 2010-07-22 19:16:42.000000000 +0100
+++ fookebox-0.6.0/debian/prerm 2012-02-13 15:27:15.000000000 +0000
@@ -20,14 +20,6 @@
        ;;
 esac
 
-# handle updates from older package versions
-if dpkg-maintscript-helper supports rm_conffile ; then
-       dpkg-maintscript-helper rm_conffile \
-               /etc/fookebox/site.conf.php 0.4.99-1 -- "$@"
-       dpkg-maintscript-helper rm_conffile \
-               /etc/fookebox/status.conf.php 0.4.99-1 -- "$@"
-fi
-
 #DEBHELPER#
 
 exit 0

Thanks,

-- 
Colin Watson                                       [cjwat...@ubuntu.com]



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to