Package: ttf-alee
Version: 12+nmu1
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 ttf-alee.
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 a handwritten postinst or postrm
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 ttf-alee-12+nmu1/debian/control ttf-alee-12+nmu1ubuntu1/debian/control
--- ttf-alee-12+nmu1/debian/control     2011-12-10 10:41:29.000000000 +0000
+++ ttf-alee-12+nmu1ubuntu1/debian/control      2012-02-12 15:18:10.000000000 
+0000
@@ -2,11 +2,12 @@
 Section: fonts
 Priority: optional
 Maintainer: A Lee <a...@debian.org>
-Build-Depends: debhelper (>= 8)
+Build-Depends: debhelper (>= 8.1.0~)
 Standards-Version: 3.9.2
 
 Package: ttf-alee
 Architecture: all
+Pre-Depends: ${misc:Pre-Depends}
 Depends: ${misc:Depends}
 Description: free Hangul TrueType fonts
  This package contains free Hangul truetype fonts made by A Lee.
diff -Nru ttf-alee-12+nmu1/debian/maintscript 
ttf-alee-12+nmu1ubuntu1/debian/maintscript
--- ttf-alee-12+nmu1/debian/maintscript 1970-01-01 01:00:00.000000000 +0100
+++ ttf-alee-12+nmu1ubuntu1/debian/maintscript  2012-02-12 15:17:14.000000000 
+0000
@@ -0,0 +1 @@
+rm_conffile /etc/defoma/hints/ttf-alee.hints 12+nmu1
diff -Nru ttf-alee-12+nmu1/debian/postinst 
ttf-alee-12+nmu1ubuntu1/debian/postinst
--- ttf-alee-12+nmu1/debian/postinst    2011-12-10 10:40:49.000000000 +0000
+++ ttf-alee-12+nmu1ubuntu1/debian/postinst     1970-01-01 01:00:00.000000000 
+0100
@@ -1,9 +0,0 @@
-#! /bin/sh
-
-set -e
-
-if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-  dpkg-maintscript-helper rm_conffile /etc/defoma/hints/ttf-alee.hints 12+nmu1 
-- "$@"
-fi
-
-#DEBHELPER#
diff -Nru ttf-alee-12+nmu1/debian/postrm ttf-alee-12+nmu1ubuntu1/debian/postrm
--- ttf-alee-12+nmu1/debian/postrm      2011-12-10 10:40:39.000000000 +0000
+++ ttf-alee-12+nmu1ubuntu1/debian/postrm       1970-01-01 01:00:00.000000000 
+0100
@@ -1,9 +0,0 @@
-#! /bin/sh
-
-set -e
-
-if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-  dpkg-maintscript-helper rm_conffile /etc/defoma/hints/ttf-alee.hints 12+nmu1 
-- "$@"
-fi
-
-#DEBHELPER#
diff -Nru ttf-alee-12+nmu1/debian/preinst ttf-alee-12+nmu1ubuntu1/debian/preinst
--- ttf-alee-12+nmu1/debian/preinst     2011-12-10 10:40:45.000000000 +0000
+++ ttf-alee-12+nmu1ubuntu1/debian/preinst      2012-02-12 15:17:31.000000000 
+0000
@@ -8,9 +8,4 @@
        fi
 fi
 
-
-if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-  dpkg-maintscript-helper rm_conffile /etc/defoma/hints/ttf-alee.hints 12+nmu1 
-- "$@"
-fi
-
 #DEBHELPER#

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