Bug#659724: ttf-mscorefonts-installer: use dh_installdeb maintscript support

2013-02-16 Thread Thijs Kinkhorst
On Mon, February 13, 2012 14:12, Colin Watson wrote:
 Package: ttf-mscorefonts-installer
 Version: 3.4
 Severity: wishlist
 Tags: patch
 User: ubuntu-de...@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-mscorefonts-installer.  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:

Thanks for the patch. I've applied it and it will be part of the next upload.

It made me wonder though: couldn't problems like this be avoided in
general if apt would automatically sort dpkg to the front of the upgrade?
I've seen this behaviour in Red Hat's up2date, rpm and yum; if any of
those packages is part of the upgrade, it's upgraded first and it restarts
itself before continuing with the rest of the packages. Do you know if
something like this has been considered in Debian?


Cheers,
Thijs


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#659724: ttf-mscorefonts-installer: use dh_installdeb maintscript support

2013-02-16 Thread Colin Watson
On Sat, Feb 16, 2013 at 12:13:23PM +0100, Thijs Kinkhorst wrote:
 Thanks for the patch. I've applied it and it will be part of the next upload.

Thanks.

 It made me wonder though: couldn't problems like this be avoided in
 general if apt would automatically sort dpkg to the front of the upgrade?
 I've seen this behaviour in Red Hat's up2date, rpm and yum; if any of
 those packages is part of the upgrade, it's upgraded first and it restarts
 itself before continuing with the rest of the packages. Do you know if
 something like this has been considered in Debian?

apt does generally try to sort Essential packages earlier (it's not
possible for it always to upgrade dpkg first, since it has Pre-Depends),
but I don't think it's wise for packages to rely on that when it's
normally so easy to avoid relying on it.  It is occasionally necessary
to upgrade dpkg in reasonably close sync with other libraries and
language bindings and the like, and that can pull a surprising number of
packages quite early in the upgrade; it's better if maintainers are in
the habit of being clear about their ordering requirements, since then
they're less likely to make mistakes if they touch base system packages.

-- 
Colin Watson   [cjwat...@ubuntu.com]


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#659724: ttf-mscorefonts-installer: use dh_installdeb maintscript support

2012-02-13 Thread Colin Watson
Package: ttf-mscorefonts-installer
Version: 3.4
Severity: wishlist
Tags: patch
User: ubuntu-de...@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-mscorefonts-installer.  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 msttcorefonts-3.4/debian/control 
msttcorefonts-3.4ubuntu2/debian/control
--- msttcorefonts-3.4/debian/control2011-11-19 20:44:19.0 +
+++ msttcorefonts-3.4ubuntu2/debian/control 2012-02-13 13:02:03.0 
+
@@ -3,13 +3,14 @@
 Priority: optional
 Maintainer: Thijs Kinkhorst th...@debian.org
 Standards-Version: 3.9.2
-Build-Depends: debhelper (= 7)
+Build-Depends: debhelper (= 8.1.0~)
 Vcs-Svn: https://svn.kinkhorst.nl/svn/debian/msttcorefonts/trunk
 Vcs-Browser: https://aphrodite.kinkhorst.nl/wsvn/debian/msttcorefonts/
 
 Package: ttf-mscorefonts-installer
 Architecture: all
+Pre-Depends: ${misc:Pre-Depends}
 Depends: wget, cabextract, xfonts-utils, ${misc:Depends}
 Recommends: fonts-liberation
 Provides: msttcorefonts
diff -Nru msttcorefonts-3.4/debian/maintscript 
msttcorefonts-3.4ubuntu2/debian/maintscript
--- msttcorefonts-3.4/debian/maintscript1970-01-01 01:00:00.0 
+0100
+++ msttcorefonts-3.4ubuntu2/debian/maintscript 2012-02-13 12:58:38.0 
+
@@ -0,0 +1 @@
+rm_conffile /etc/defoma/hints/ttf-mscorefonts-installer.hints 3.4
diff -Nru msttcorefonts-3.4/debian/postinst.in 
msttcorefonts-3.4ubuntu2/debian/postinst.in
--- msttcorefonts-3.4/debian/postinst.in2011-11-19 20:34:01.0 
+
+++ msttcorefonts-3.4ubuntu2/debian/postinst.in 2012-02-13 13:01:02.0 
+
@@ -25,9 +25,5 @@
 http_proxy=$RET
 done
 
-if dpkg-maintscript-helper supports rm_conffile 2/dev/null; then
-  dpkg-maintscript-helper rm_conffile 
/etc/defoma/hints/ttf-mscorefonts-installer.hints 3.4 -- $@
-fi
-  
 ## Content of update-ms-fonts will be concatenated below
 
diff -Nru msttcorefonts-3.4/debian/postrm msttcorefonts-3.4ubuntu2/debian/postrm
--- msttcorefonts-3.4/debian/postrm 2011-11-19 20:34:01.0 +
+++ msttcorefonts-3.4ubuntu2/debian/postrm  2012-02-13 13:01:49.0 
+
@@ -2,8 +2,4 @@
 
 set -e
 
-if dpkg-maintscript-helper supports rm_conffile 2/dev/null; then
-  dpkg-maintscript-helper rm_conffile 
/etc/defoma/hints/ttf-mscorefonts-installer.hints 3.4 -- $@
-fi
-
 #DEBHELPER#
diff -Nru msttcorefonts-3.4/debian/preinst 
msttcorefonts-3.4ubuntu2/debian/preinst
--- msttcorefonts-3.4/debian/preinst2011-11-19 20:34:01.0 +
+++ msttcorefonts-3.4ubuntu2/debian/preinst 2012-02-13 13:00:19.0 
+
@@ -9,8 +9,4 @@
 fi
 
 
-if dpkg-maintscript-helper supports rm_conffile 2/dev/null; then
-  dpkg-maintscript-helper rm_conffile 
/etc/defoma/hints/ttf-mscorefonts-installer.hints 3.4 -- $@
-fi
-
 #DEBHELPER#

Thanks,

-- 
Colin Watson   [cjwat...@ubuntu.com]



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org