[Pkg-fonts-devel] Bug#659716: ttf-georgewilliams: use dh_installdeb maintscript support

Colin Watson cjwatson at ubuntu.com
Mon Feb 13 12:35:33 UTC 2012


Package: ttf-georgewilliams
Version: 1.0-5
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
ttf-georgewilliams.  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 gw-fonts-ttf-1.0/debian/control gw-fonts-ttf-1.0/debian/control
--- gw-fonts-ttf-1.0/debian/control	2011-07-21 17:19:34.000000000 +0100
+++ gw-fonts-ttf-1.0/debian/control	2012-02-13 12:33:26.000000000 +0000
@@ -3,12 +3,13 @@
 Priority: optional
 Maintainer: Debian Fonts Task Force <pkg-fonts-devel at lists.alioth.debian.org>
 Uploaders: Christian Perrier <bubulle at debian.org>
-Build-Depends: debhelper (>= 8), unzip
+Build-Depends: debhelper (>= 8.1.0~), unzip
 Homepage: http://fontforge.sourceforge.net/sfds/
 Standards-Version: 3.9.2
 
 Package: ttf-georgewilliams
 Architecture: all
+Pre-Depends: ${misc:Pre-Depends}
 Depends: ${misc:Depends}
 Description: Free unicode TrueType fonts by George Williams
  A set of Free unicode True Type fonts made by George Williams.
diff -Nru gw-fonts-ttf-1.0/debian/maintscript gw-fonts-ttf-1.0/debian/maintscript
--- gw-fonts-ttf-1.0/debian/maintscript	1970-01-01 01:00:00.000000000 +0100
+++ gw-fonts-ttf-1.0/debian/maintscript	2012-02-13 12:32:58.000000000 +0000
@@ -0,0 +1 @@
+rm_conffile /etc/defoma/hints/ttf-georgewilliams.hints 1.0-5
diff -Nru gw-fonts-ttf-1.0/debian/postinst gw-fonts-ttf-1.0/debian/postinst
--- gw-fonts-ttf-1.0/debian/postinst	2011-07-21 16:17:13.000000000 +0100
+++ gw-fonts-ttf-1.0/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-georgewilliams.hints 1.0-5 -- "$@"
-fi
-
-#DEBHELPER#
-
diff -Nru gw-fonts-ttf-1.0/debian/postrm gw-fonts-ttf-1.0/debian/postrm
--- gw-fonts-ttf-1.0/debian/postrm	2011-07-21 16:17:25.000000000 +0100
+++ gw-fonts-ttf-1.0/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-georgewilliams.hints 1.0-5 -- "$@"
-fi
-
-#DEBHELPER#
-
diff -Nru gw-fonts-ttf-1.0/debian/preinst gw-fonts-ttf-1.0/debian/preinst
--- gw-fonts-ttf-1.0/debian/preinst	2011-07-21 16:17:44.000000000 +0100
+++ gw-fonts-ttf-1.0/debian/preinst	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-georgewilliams.hints 1.0-5 -- "$@"
-fi
-
-#DEBHELPER#
-

Thanks,

-- 
Colin Watson                                       [cjwatson at ubuntu.com]





More information about the Pkg-fonts-devel mailing list