Package: uptimed
Version: 1:0.3.16-3.2
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 uptimed.
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 -u uptimed-0.3.16/debian/control uptimed-0.3.16/debian/control
--- uptimed-0.3.16/debian/control
+++ uptimed-0.3.16/debian/control
@@ -2,11 +2,12 @@
 Section: utils
 Priority: extra
 Maintainer: Thibaut VARENE <vare...@debian.org>
-Build-Depends: debhelper (>= 7), quilt, automake, libtool
+Build-Depends: debhelper (>= 8.1.0~), quilt, automake, libtool
 Standards-Version: 3.8.0
 
 Package: uptimed
 Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
 Depends: ${misc:Depends}, ${shlibs:Depends}
 Description: Utility to track your highest uptimes
  Uptimed allows you to track your highest uptimes via boot IDs.
diff -u uptimed-0.3.16/debian/uptimed.postinst 
uptimed-0.3.16/debian/uptimed.postinst
--- uptimed-0.3.16/debian/uptimed.postinst
+++ uptimed-0.3.16/debian/uptimed.postinst
@@ -68,7 +68,2 @@
 
-# remove old bootid creating script.
-if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-       dpkg-maintscript-helper rm_conffile /etc/init.d/uptimed.sh 1:0.3.16-3.1 
-- "$@"
-fi
-
 #DEBHELPER#
diff -u uptimed-0.3.16/debian/uptimed.postrm 
uptimed-0.3.16/debian/uptimed.postrm
--- uptimed-0.3.16/debian/uptimed.postrm
+++ uptimed-0.3.16/debian/uptimed.postrm
@@ -1,10 +1,5 @@
 #!/bin/sh
 
-# remove old bootid creating script.
-if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-       dpkg-maintscript-helper rm_conffile /etc/init.d/uptimed.sh 1:0.3.16-3.1 
-- "$@"
-fi
-
 #DEBHELPER#
 
 if [ "$1" = "purge" ]; then
diff -u uptimed-0.3.16/debian/uptimed.preinst 
uptimed-0.3.16/debian/uptimed.preinst
--- uptimed-0.3.16/debian/uptimed.preinst
+++ uptimed-0.3.16/debian/uptimed.preinst
@@ -3,9 +3,6 @@
 set -e
 
-# remove old bootid creating script and symlinks from rcS.
-if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-       update-rc.d -f uptimed.sh remove
-       dpkg-maintscript-helper rm_conffile /etc/init.d/uptimed.sh 1:0.3.16-3.1 
-- "$@"
-fi
+# Remove symlinks from rcS.
+update-rc.d -f uptimed.sh remove
 
 #DEBHELPER#
only in patch2:
unchanged:
--- uptimed-0.3.16.orig/debian/uptimed.maintscript
+++ uptimed-0.3.16/debian/uptimed.maintscript
@@ -0,0 +1,2 @@
+# Remove old bootid creating script.
+rm_conffile /etc/init.d/uptimed.sh 1:0.3.16-3.1

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