[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#659608: lmodern: use dh_installdeb maintscript support



Package: lmodern
Version: 2.004.1-3.1
Severity: wishlist
Tags: patch
User: ubuntu-devel@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 lmodern.
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 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 -u lmodern-2.004.1/debian/control lmodern-2.004.1/debian/control
--- lmodern-2.004.1/debian/control
+++ lmodern-2.004.1/debian/control
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Debian TeX maintainers <debian-tex-maint@lists.debian.org>
 Uploaders: Julian Gilbey <jdg@debian.org>, C.M. Connelly <cmc@debian.org>, Atsuhito KOHDA <kohda@debian.org>, Frank Küster <frank@debian.org>, Florent Rougon <frn@debian.org>, Norbert Preining <preining@debian.org>
-Build-Depends: debhelper (>= 7)
+Build-Depends: debhelper (>= 8.1.0~)
 Build-Depends-Indep: tex-common (>= 1.18)
 Standards-Version: 3.8.3
 Vcs-Svn: svn://svn.debian.org/svn/debian-tex/lmodern/trunk
@@ -13,6 +13,7 @@
 Package: lmodern
 Section: fonts
 Architecture: all
+Pre-Depends: ${misc:Pre-Depends}
 Depends: ${misc:Depends}
 Conflicts: lm, lmodern-x11, context (<= 2008.10.31-1)
 Replaces: lm, lmodern-x11
reverted:
--- lmodern-2.004.1/debian/lmodern.postinst
+++ lmodern-2.004.1.orig/debian/lmodern.postinst
@@ -1,11 +0,0 @@
-#! /bin/sh -e
-
-
-if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-  dpkg-maintscript-helper rm_conffile /etc/defoma/hints/lmodern.hints 2.004.1-3.1 -- "$@"
-fi
-
-
-#DEBHELPER#
-
-exit 0
diff -u lmodern-2.004.1/debian/lmodern.preinst lmodern-2.004.1/debian/lmodern.preinst
--- lmodern-2.004.1/debian/lmodern.preinst
+++ lmodern-2.004.1/debian/lmodern.preinst
@@ -248,11 +248,6 @@
 fi
 
 
-if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-  dpkg-maintscript-helper rm_conffile /etc/defoma/hints/lmodern.hints 2.004.1-3.1 -- "$@"
-fi
-
-
 #DEBHELPER#
 
 exit 0
diff -u lmodern-2.004.1/debian/lmodern.postrm lmodern-2.004.1/debian/lmodern.postrm
--- lmodern-2.004.1/debian/lmodern.postrm
+++ lmodern-2.004.1/debian/lmodern.postrm
@@ -55,10 +55,6 @@
         ;;
 esac
 
-if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-  dpkg-maintscript-helper rm_conffile /etc/defoma/hints/lmodern.hints 2.004.1-3.1 -- "$@"
-fi
-
 
 #DEBHELPER#
 
only in patch2:
unchanged:
--- lmodern-2.004.1.orig/debian/lmodern.maintscript
+++ lmodern-2.004.1/debian/lmodern.maintscript
@@ -0,0 +1 @@
+rm_conffile /etc/defoma/hints/lmodern.hints 2.004.1-3.1

Thanks,

-- 
Colin Watson                                       [cjwatson@ubuntu.com]



Reply to: