[Pkg-xfce-devel] Bug#659892: xfce4-utils: use dh_installdeb maintscript support
Package: xfce4-utils
Version: 4.8.3-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 xfce4-utils.
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.
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 xfce4-utils-4.8.3/debian/control xfce4-utils-4.8.3/debian/control
--- xfce4-utils-4.8.3/debian/control 2011-10-24 21:48:14.000000000 +0100
+++ xfce4-utils-4.8.3/debian/control 2012-02-14 15:33:41.000000000 +0000
@@ -16,6 +16,7 @@
Package: xfce4-utils
Section: xfce
Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
Depends: ${shlibs:Depends}, ${misc:Depends}, xterm|x-terminal-emulator,
x11-xserver-utils, xinit, exo-utils, procps
Recommends: xfwm4, xfce4-panel, thunar, xscreensaver | xlockmore |
diff -Nru xfce4-utils-4.8.3/debian/maintscript xfce4-utils-4.8.3/debian/maintscript
--- xfce4-utils-4.8.3/debian/maintscript 1970-01-01 01:00:00.000000000 +0100
+++ xfce4-utils-4.8.3/debian/maintscript 2012-02-14 15:32:48.000000000 +0000
@@ -0,0 +1 @@
+rm_conffile /etc/xdg/autostart/xfconf-migration-4.6.desktop 4.8.1-1
diff -Nru xfce4-utils-4.8.3/debian/postinst xfce4-utils-4.8.3/debian/postinst
--- xfce4-utils-4.8.3/debian/postinst 2011-04-11 14:58:39.000000000 +0100
+++ xfce4-utils-4.8.3/debian/postinst 2012-02-14 15:32:58.000000000 +0000
@@ -7,11 +7,6 @@
x-session-manager.1.gz /usr/share/man/man1/startxfce4.1.gz
fi
-if dpkg-maintscript-helper supports rm_conffile; then
- dpkg-maintscript-helper rm_conffile \
- /etc/xdg/autostart/xfconf-migration-4.6.desktop "4.8.1-1" -- "$@"
-fi
-
#DEBHELPER#
exit 0
diff -Nru xfce4-utils-4.8.3/debian/postrm xfce4-utils-4.8.3/debian/postrm
--- xfce4-utils-4.8.3/debian/postrm 2011-04-11 14:58:39.000000000 +0100
+++ xfce4-utils-4.8.3/debian/postrm 2012-02-14 15:33:02.000000000 +0000
@@ -1,11 +1,6 @@
#!/bin/sh
set -e
-if dpkg-maintscript-helper supports rm_conffile; then
- dpkg-maintscript-helper rm_conffile \
- /etc/xdg/autostart/xfconf-migration-4.6.desktop "4.8.1-1" -- "$@"
-fi
-
if [ "$1" = "purge" ]; then
rm -f /etc/dm/Sessions/xfce4.desktop
fi
diff -Nru xfce4-utils-4.8.3/debian/preinst xfce4-utils-4.8.3/debian/preinst
--- xfce4-utils-4.8.3/debian/preinst 2011-06-18 08:06:10.000000000 +0100
+++ xfce4-utils-4.8.3/debian/preinst 2012-02-14 15:32:55.000000000 +0000
@@ -10,11 +10,6 @@
fi
-if dpkg-maintscript-helper supports rm_conffile; then
- dpkg-maintscript-helper rm_conffile \
- /etc/xdg/autostart/xfconf-migration-4.6.desktop "4.8.1-1" -- "$@"
-fi
-
# Remove symlinks for el which appeared in 4.8.2-1
case "$1" in
install|upgrade)
Thanks,
--
Colin Watson [cjwatson at ubuntu.com]
Reply to: