[Pkg-fonts-devel] Bug#659600: fonts-mplus: use dh_installdeb maintscript support
Colin Watson
cjwatson at ubuntu.com
Sun Feb 12 13:49:27 UTC 2012
Package: fonts-mplus
Version: 045-1
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 fonts-mplus.
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 fonts-mplus-045/debian/control fonts-mplus-045/debian/control
--- fonts-mplus-045/debian/control 2011-10-07 12:06:52.000000000 +0100
+++ fonts-mplus-045/debian/control 2012-02-12 13:45:04.000000000 +0000
@@ -3,12 +3,13 @@
Priority: optional
Maintainer: Debian Fonts Task Force <pkg-fonts-devel at lists.alioth.debian.org>
Uploaders: Gürkan Sengün <gurkan at phys.ethz.ch>
-Build-Depends: debhelper (>= 8)
+Build-Depends: debhelper (>= 8.1.0~)
Standards-Version: 3.9.2
Homepage: http://mplus-fonts.sourceforge.jp/
Package: fonts-mplus
Architecture: all
+Pre-Depends: ${misc:Pre-Depends}
Depends: ${misc:Depends}
Replaces: ttf-mplus (<< 042-1)
Conflicts: ttf-mplus (<< 042-1)
diff -Nru fonts-mplus-045/debian/maintscript fonts-mplus-045/debian/maintscript
--- fonts-mplus-045/debian/maintscript 1970-01-01 01:00:00.000000000 +0100
+++ fonts-mplus-045/debian/maintscript 2012-02-12 13:44:17.000000000 +0000
@@ -0,0 +1 @@
+rm_conffile /etc/defoma/hints/ttf-mplus.hints 040-1
diff -Nru fonts-mplus-045/debian/postinst fonts-mplus-045/debian/postinst
--- fonts-mplus-045/debian/postinst 2011-06-14 13:15:10.000000000 +0100
+++ fonts-mplus-045/debian/postinst 1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-set -e
-
-CFILE='/etc/defoma/hints/ttf-mplus.hints'
-dpkg-maintscript-helper rm_conffile $CFILE 040-1 -- "$@"
-
-#DEBHELPER#
diff -Nru fonts-mplus-045/debian/postrm fonts-mplus-045/debian/postrm
--- fonts-mplus-045/debian/postrm 2011-06-14 13:15:05.000000000 +0100
+++ fonts-mplus-045/debian/postrm 1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-set -e
-
-CFILE='/etc/defoma/hints/ttf-mplus.hints'
-dpkg-maintscript-helper rm_conffile $CFILE 040-1 -- "$@"
-
-#DEBHELPER#
diff -Nru fonts-mplus-045/debian/preinst fonts-mplus-045/debian/preinst
--- fonts-mplus-045/debian/preinst 2011-06-14 13:14:58.000000000 +0100
+++ fonts-mplus-045/debian/preinst 1970-01-01 01:00:00.000000000 +0100
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-set -e
-
-CFILE='/etc/defoma/hints/ttf-mplus.hints'
-if dpkg-maintscript-helper supports rm_conffile; then
- dpkg-maintscript-helper rm_conffile $CFILE 040-1 -- "$@"
-fi
-
-#DEBHELPER#
Thanks,
--
Colin Watson [cjwatson at ubuntu.com]
More information about the Pkg-fonts-devel
mailing list