[Pkg-lyx-devel] Bug#659721: ttf-lyx: use dh_installdeb maintscript support

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


Package: ttf-lyx
Version: 2.0.2-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 ttf-lyx.
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 lyx-2.0.2/debian/control lyx-2.0.2/debian/control
--- lyx-2.0.2/debian/control	2011-10-31 09:32:56.000000000 +0000
+++ lyx-2.0.2/debian/control	2012-02-13 12:51:09.000000000 +0000
@@ -7,7 +7,7 @@
 Vcs-Git: git://anonscm.debian.org/pkg-lyx/lyx.git
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-lyx/lyx.git
 Homepage: http://www.lyx.org/
-Build-Depends: python (>= 2.6.6-3), debhelper (>= 8),
+Build-Depends: python (>= 2.6.6-3), debhelper (>= 8.1.0~),
  libz-dev, libx11-dev, libenchant-dev, libmythes-dev,
  autotools-dev, libqt4-dev, libboost-dev,
  libboost-filesystem-dev, libboost-signals-dev,
@@ -54,6 +54,7 @@
 Package: ttf-lyx
 Architecture: all
 Section: fonts
+Pre-Depends: ${misc:Pre-Depends}
 Depends: ${misc:Depends}
 Description: TrueType versions of some TeX fonts
  These fonts are needed for the visual math symbol display in
diff -Nru lyx-2.0.2/debian/ttf-lyx.maintscript lyx-2.0.2/debian/ttf-lyx.maintscript
--- lyx-2.0.2/debian/ttf-lyx.maintscript	1970-01-01 01:00:00.000000000 +0100
+++ lyx-2.0.2/debian/ttf-lyx.maintscript	2012-02-13 12:50:38.000000000 +0000
@@ -0,0 +1 @@
+rm_conffile /etc/defoma/hints/ttf-lyx.hints 2.0.0~rc1-1
diff -Nru lyx-2.0.2/debian/ttf-lyx.postinst lyx-2.0.2/debian/ttf-lyx.postinst
--- lyx-2.0.2/debian/ttf-lyx.postinst	2011-10-18 10:50:02.000000000 +0100
+++ lyx-2.0.2/debian/ttf-lyx.postinst	1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-set -e 
-
-CFILE='/etc/defoma/hints/ttf-lyx.hints'
-dpkg-maintscript-helper rm_conffile $CFILE 2.0.0~rc1-1 -- "$@"
-
-#DEBHELPER#
diff -Nru lyx-2.0.2/debian/ttf-lyx.postrm lyx-2.0.2/debian/ttf-lyx.postrm
--- lyx-2.0.2/debian/ttf-lyx.postrm	2011-10-18 10:50:02.000000000 +0100
+++ lyx-2.0.2/debian/ttf-lyx.postrm	1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-set -e 
-
-CFILE='/etc/defoma/hints/ttf-lyx.hints'
-dpkg-maintscript-helper rm_conffile $CFILE 2.0.0~beta4-1 -- "$@"
-
-#DEBHELPER#
diff -Nru lyx-2.0.2/debian/ttf-lyx.preinst lyx-2.0.2/debian/ttf-lyx.preinst
--- lyx-2.0.2/debian/ttf-lyx.preinst	2011-10-18 10:50:02.000000000 +0100
+++ lyx-2.0.2/debian/ttf-lyx.preinst	1970-01-01 01:00:00.000000000 +0100
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-set -e 
-
-CFILE='/etc/defoma/hints/ttf-lyx.hints'
-if dpkg-maintscript-helper supports rm_conffile; then
-    dpkg-maintscript-helper rm_conffile $CFILE 2.0.0~beta4-1 -- "$@"
-fi
-
-#DEBHELPER#

Thanks,

-- 
Colin Watson                                       [cjwatson at ubuntu.com]





More information about the Pkg-lyx-devel mailing list