[Pkg-xfce-devel] Bug#659901: libexo-common: use dh_installdeb maintscript support

Colin Watson cjwatson at ubuntu.com
Tue Feb 14 17:19:14 UTC 2012


Package: libexo-common
Version: 0.6.2-3
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
libexo-common.  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 could remove your handwritten postinst and postrm scripts
entirely.  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 exo-0.6.2/debian/control exo-0.6.2/debian/control
--- exo-0.6.2/debian/control	2011-10-16 20:45:05.000000000 +0100
+++ exo-0.6.2/debian/control	2012-02-14 17:16:59.000000000 +0000
@@ -84,6 +84,7 @@
 Section: libs
 Architecture: all
 Multi-Arch: foreign
+Pre-Depends: ${misc:Pre-Depends}
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Replaces: libexo-0.3-0 (<< 0.3.104-3)
 Description: libexo common files
diff -Nru exo-0.6.2/debian/libexo-common.maintscript exo-0.6.2/debian/libexo-common.maintscript
--- exo-0.6.2/debian/libexo-common.maintscript	1970-01-01 01:00:00.000000000 +0100
+++ exo-0.6.2/debian/libexo-common.maintscript	2012-02-14 17:15:53.000000000 +0000
@@ -0,0 +1 @@
+rm_conffile /etc/xdg/xfce4/mount.rc 0.5.2-1
diff -Nru exo-0.6.2/debian/libexo-common.postinst exo-0.6.2/debian/libexo-common.postinst
--- exo-0.6.2/debian/libexo-common.postinst	2011-03-30 17:08:38.000000000 +0100
+++ exo-0.6.2/debian/libexo-common.postinst	1970-01-01 01:00:00.000000000 +0100
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-set -e
-
-LASTVER="0.5.2-1" 
-
-if dpkg-maintscript-helper supports rm_conffile; then
-  dpkg-maintscript-helper rm_conffile \
-    /etc/xdg/xfce4/mount.rc "$LASTVER" -- "$@"
-fi
-
-#DEBHELPER#
diff -Nru exo-0.6.2/debian/libexo-common.postrm exo-0.6.2/debian/libexo-common.postrm
--- exo-0.6.2/debian/libexo-common.postrm	2011-03-30 17:08:38.000000000 +0100
+++ exo-0.6.2/debian/libexo-common.postrm	1970-01-01 01:00:00.000000000 +0100
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-set -e
-
-LASTVER="0.5.2-1" 
-
-if dpkg-maintscript-helper supports rm_conffile; then
-  dpkg-maintscript-helper rm_conffile \
-    /etc/xdg/xfce4/mount.rc "$LASTVER" -- "$@"
-fi
-
-#DEBHELPER#
diff -Nru exo-0.6.2/debian/libexo-common.preinst exo-0.6.2/debian/libexo-common.preinst
--- exo-0.6.2/debian/libexo-common.preinst	2011-05-13 13:35:06.000000000 +0100
+++ exo-0.6.2/debian/libexo-common.preinst	2012-02-14 17:16:06.000000000 +0000
@@ -2,13 +2,6 @@
 
 set -e
 
-LASTVER="0.5.2-1" 
-
-if dpkg-maintscript-helper supports rm_conffile; then
-  dpkg-maintscript-helper rm_conffile \
-    /etc/xdg/xfce4/mount.rc "$LASTVER" -- "$@"
-fi
-
 # Remove symlinks for el and sv which appeared in 0.6.1-1
 case "$1" in
 install|upgrade)

Thanks,

-- 
Colin Watson                                       [cjwatson at ubuntu.com]





More information about the Pkg-xfce-devel mailing list