Package: scalable-cyrfonts
Version: 4.14
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
t1-cyrillic/t1-oldslavic/t1-teams.  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 scalable-cyrfonts-4.14/debian/control 
scalable-cyrfonts-4.14ubuntu1/debian/control
--- scalable-cyrfonts-4.14/debian/control       2011-11-29 12:24:13.000000000 
+0000
+++ scalable-cyrfonts-4.14ubuntu1/debian/control        2012-02-13 
14:31:15.000000000 +0000
@@ -3,7 +3,7 @@
 Section: text
 Priority: optional
 Standards-Version: 3.8.1
-Build-Depends: debhelper (>= 5.0.31), tar (>=1.13.18), bzip2, fontforge, 
gsfonts, zip, tofrodos, xfonts-utils, texlive, texlive-font-utils, tex-common 
(>= 1.18)
+Build-Depends: debhelper (>= 8.1.0~), tar (>=1.13.18), bzip2, fontforge, 
gsfonts, zip, tofrodos, xfonts-utils, texlive, texlive-font-utils, tex-common 
(>= 1.18)
 
 Package: t1-cyrillic
 Architecture: all
@@ -21,6 +22,7 @@
  infringements.
 Section: x11
 Priority: optional
+Pre-Depends: ${misc:Pre-Depends}
 Depends: ${misc:Depends}
 Suggests: xfs (>=4.0) | xserver
 Conflicts: xbase-clients (<< 4.0), scalable-cyrfonts-x11, scalable-cyrfonts
@@ -38,6 +40,7 @@
  Bulgarian and Russian Cyrillic characters.
 Section: x11
 Priority: optional
+Pre-Depends: ${misc:Pre-Depends}
 Depends: ${misc:Depends}
 Suggests: xfs (>=4.0) | xserver
 Conflicts: xbase-clients (<< 4.0), scalable-cyrfonts-x11, scalable-cyrfonts
@@ -54,6 +57,7 @@
  it.
 Section: text
 Priority: optional
+Pre-Depends: ${misc:Pre-Depends}
 Depends: ${misc:Depends}
 Suggests: xfs (>=4.0) | xserver
 Conflicts: xbase-clients (<< 4.0), scalable-cyrfonts-x11, scalable-cyrfonts
diff -Nru scalable-cyrfonts-4.14/debian/t1-cyrillic.maintscript 
scalable-cyrfonts-4.14ubuntu1/debian/t1-cyrillic.maintscript
--- scalable-cyrfonts-4.14/debian/t1-cyrillic.maintscript       1970-01-01 
01:00:00.000000000 +0100
+++ scalable-cyrfonts-4.14ubuntu1/debian/t1-cyrillic.maintscript        
2012-02-13 14:27:59.000000000 +0000
@@ -0,0 +1,3 @@
+rm_conffile /etc/X11/fonts/X11R7/Type1/t1-cyrillic.scale 4.12+nmu1
+rm_conffile /etc/X11/fonts/X11R7/Type1/t1-cyrillic.alias 4.12+nmu1
+rm_conffile /etc/defoma/hints/t1-cyrillic.hints 4.14
diff -Nru scalable-cyrfonts-4.14/debian/t1-cyrillic.postinst 
scalable-cyrfonts-4.14ubuntu1/debian/t1-cyrillic.postinst
--- scalable-cyrfonts-4.14/debian/t1-cyrillic.postinst  2011-11-29 
13:02:55.000000000 +0000
+++ scalable-cyrfonts-4.14ubuntu1/debian/t1-cyrillic.postinst   2012-02-13 
14:28:22.000000000 +0000
@@ -10,8 +10,4 @@
        fc-cache /usr/share/fonts/X11/Type1
 fi
 
-if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-  dpkg-maintscript-helper rm_conffile /etc/defoma/hints/t1-cyrillic.hints 4.14 
-- "$@"
-fi
-
 #DEBHELPER#
diff -Nru scalable-cyrfonts-4.14/debian/t1-cyrillic.postrm 
scalable-cyrfonts-4.14ubuntu1/debian/t1-cyrillic.postrm
--- scalable-cyrfonts-4.14/debian/t1-cyrillic.postrm    2011-11-29 
12:24:13.000000000 +0000
+++ scalable-cyrfonts-4.14ubuntu1/debian/t1-cyrillic.postrm     2012-02-13 
14:28:39.000000000 +0000
@@ -20,7 +20,3 @@
    ;;
 esac
 
-if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-  dpkg-maintscript-helper rm_conffile /etc/defoma/hints/t1-cyrillic.hints 4.14 
-- "$@"
-fi
-
diff -Nru scalable-cyrfonts-4.14/debian/t1-cyrillic.preinst 
scalable-cyrfonts-4.14ubuntu1/debian/t1-cyrillic.preinst
--- scalable-cyrfonts-4.14/debian/t1-cyrillic.preinst   2011-11-29 
12:50:45.000000000 +0000
+++ scalable-cyrfonts-4.14ubuntu1/debian/t1-cyrillic.preinst    2012-02-13 
14:28:17.000000000 +0000
@@ -2,32 +2,13 @@
 
 set -e
 
-# Remove a no-longer used conffile
-rm_conffile() {
-    CONFFILE="$1"
-
-    if [ -e "$CONFFILE" ]; then
-        echo "Removing obsolete conffile $CONFFILE ..."
-        rm -f "$CONFFILE"
-    fi
-}
-
 case "$1" in
     install|upgrade)
-        # clear obsolete conffiles left from etch (4.10-0.1)
-        if dpkg --compare-versions "$2" le "4.12+nmu1"; then
-            rm_conffile "/etc/X11/fonts/X11R7/Type1/t1-cyrillic.scale"
-            rm_conffile "/etc/X11/fonts/X11R7/Type1/t1-cyrillic.alias"
-        fi
         if dpkg --compare-versions "$2" lt 4.14; then
            if [ -x "which defoma-font 2>/dev/null" ]; then
                defoma-font purge /etc/defoma/hints/t1-cyrillic.hints
            fi
         fi
-        if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-            dpkg-maintscript-helper rm_conffile \
-                /etc/defoma/hints/t1-cyrillic.hints 4.14 -- "$@"
-        fi
     ;;
 
     abort-upgrade)
diff -Nru scalable-cyrfonts-4.14/debian/t1-oldslavic.maintscript 
scalable-cyrfonts-4.14ubuntu1/debian/t1-oldslavic.maintscript
--- scalable-cyrfonts-4.14/debian/t1-oldslavic.maintscript      1970-01-01 
01:00:00.000000000 +0100
+++ scalable-cyrfonts-4.14ubuntu1/debian/t1-oldslavic.maintscript       
2012-02-13 14:29:28.000000000 +0000
@@ -0,0 +1,3 @@
+rm_conffile /etc/X11/fonts/X11R7/Type1/t1-oldslavic.scale 4.12+nmu1
+rm_conffile /etc/X11/fonts/X11R7/Type1/t1-oldslavic.alias 4.12+nmu1
+rm_conffile /etc/defoma/hints/t1-oldslavic.hints 4.14
diff -Nru scalable-cyrfonts-4.14/debian/t1-oldslavic.postinst 
scalable-cyrfonts-4.14ubuntu1/debian/t1-oldslavic.postinst
--- scalable-cyrfonts-4.14/debian/t1-oldslavic.postinst 2011-11-29 
12:24:13.000000000 +0000
+++ scalable-cyrfonts-4.14ubuntu1/debian/t1-oldslavic.postinst  2012-02-13 
14:29:41.000000000 +0000
@@ -8,9 +8,5 @@
        fc-cache /usr/share/fonts/X11/Type1
 fi
 
-if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-  dpkg-maintscript-helper rm_conffile /etc/defoma/hints/t1-oldslavic.hints 
4.14 -- "$@"
-fi
-
 #DEBHELPER#
 
diff -Nru scalable-cyrfonts-4.14/debian/t1-oldslavic.postrm 
scalable-cyrfonts-4.14ubuntu1/debian/t1-oldslavic.postrm
--- scalable-cyrfonts-4.14/debian/t1-oldslavic.postrm   2011-11-29 
12:24:13.000000000 +0000
+++ scalable-cyrfonts-4.14ubuntu1/debian/t1-oldslavic.postrm    2012-02-13 
14:29:44.000000000 +0000
@@ -20,7 +20,3 @@
    ;;
 esac
 
-if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-  dpkg-maintscript-helper rm_conffile /etc/defoma/hints/t1-oldslavic.hints 
4.14 -- "$@"
-fi
-
diff -Nru scalable-cyrfonts-4.14/debian/t1-oldslavic.preinst 
scalable-cyrfonts-4.14ubuntu1/debian/t1-oldslavic.preinst
--- scalable-cyrfonts-4.14/debian/t1-oldslavic.preinst  2011-11-29 
12:51:15.000000000 +0000
+++ scalable-cyrfonts-4.14ubuntu1/debian/t1-oldslavic.preinst   2012-02-13 
14:29:38.000000000 +0000
@@ -2,32 +2,13 @@
 
 set -e
 
-# Remove a no-longer used conffile
-rm_conffile() {
-    CONFFILE="$1"
-
-    if [ -e "$CONFFILE" ]; then
-        echo "Removing obsolete conffile $CONFFILE ..."
-        rm -f "$CONFFILE"
-    fi
-}
-
 case "$1" in
     install|upgrade)
-        # clear obsolete conffiles left from etch (4.10-0.1)
-        if dpkg --compare-versions "$2" le "4.12+nmu1"; then
-            rm_conffile "/etc/X11/fonts/X11R7/Type1/t1-oldslavic.scale"
-            rm_conffile "/etc/X11/fonts/X11R7/Type1/t1-oldslavic.alias"
-        fi
         if dpkg --compare-versions "$2" lt 4.14; then
            if [ -x "which defoma-font 2>/dev/null" ]; then
                defoma-font purge /etc/defoma/hints/t1-oldslavic.hints
            fi
         fi
-        if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-            dpkg-maintscript-helper rm_conffile \
-                /etc/defoma/hints/t1-oldslavic.hints 4.14 -- "$@"
-        fi
         ;;
 
     abort-upgrade)
diff -Nru scalable-cyrfonts-4.14/debian/t1-teams.maintscript 
scalable-cyrfonts-4.14ubuntu1/debian/t1-teams.maintscript
--- scalable-cyrfonts-4.14/debian/t1-teams.maintscript  1970-01-01 
01:00:00.000000000 +0100
+++ scalable-cyrfonts-4.14ubuntu1/debian/t1-teams.maintscript   2012-02-13 
14:30:29.000000000 +0000
@@ -0,0 +1,3 @@
+rm_conffile /etc/X11/fonts/X11R7/Type1/t1-teams.scale 4.12+nmu1
+rm_conffile /etc/X11/fonts/X11R7/Type1/t1-teams.alias 4.12+nmu1
+rm_conffile /etc/defoma/hints/t1-teams.hints 4.14
diff -Nru scalable-cyrfonts-4.14/debian/t1-teams.postinst 
scalable-cyrfonts-4.14ubuntu1/debian/t1-teams.postinst
--- scalable-cyrfonts-4.14/debian/t1-teams.postinst     2011-11-29 
12:24:13.000000000 +0000
+++ scalable-cyrfonts-4.14ubuntu1/debian/t1-teams.postinst      2012-02-13 
14:30:42.000000000 +0000
@@ -8,9 +8,5 @@
        fc-cache /usr/share/fonts/X11/Type1
 fi
 
-if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-  dpkg-maintscript-helper rm_conffile /etc/defoma/hints/t1-teams.hints 4.14 -- 
"$@"
-fi
-
 #DEBHELPER#
 
diff -Nru scalable-cyrfonts-4.14/debian/t1-teams.postrm 
scalable-cyrfonts-4.14ubuntu1/debian/t1-teams.postrm
--- scalable-cyrfonts-4.14/debian/t1-teams.postrm       2011-11-29 
12:24:13.000000000 +0000
+++ scalable-cyrfonts-4.14ubuntu1/debian/t1-teams.postrm        2012-02-13 
14:30:47.000000000 +0000
@@ -20,7 +20,3 @@
    ;;
 esac
 
-if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-  dpkg-maintscript-helper rm_conffile /etc/defoma/hints/t1-teams.hints 4.14 -- 
"$@"
-fi
-
diff -Nru scalable-cyrfonts-4.14/debian/t1-teams.preinst 
scalable-cyrfonts-4.14ubuntu1/debian/t1-teams.preinst
--- scalable-cyrfonts-4.14/debian/t1-teams.preinst      2011-11-29 
12:51:43.000000000 +0000
+++ scalable-cyrfonts-4.14ubuntu1/debian/t1-teams.preinst       2012-02-13 
14:30:40.000000000 +0000
@@ -2,32 +2,13 @@
 
 set -e
 
-# Remove a no-longer used conffile
-rm_conffile() {
-    CONFFILE="$1"
-
-    if [ -e "$CONFFILE" ]; then
-        echo "Removing obsolete conffile $CONFFILE ..."
-        rm -f "$CONFFILE"
-    fi
-}
-
 case "$1" in
     install|upgrade)
-        # clear obsolete conffiles left from etch (4.10-0.1)
-        if dpkg --compare-versions "$2" le "4.12+nmu1"; then
-            rm_conffile "/etc/X11/fonts/X11R7/Type1/t1-teams.scale"
-            rm_conffile "/etc/X11/fonts/X11R7/Type1/t1-teams.alias"
-        fi
         if dpkg --compare-versions "$2" lt 4.14; then
            if [ -x "which defoma-font 2>/dev/null" ]; then
                defoma-font purge /etc/defoma/hints/t1-teams.hints
            fi
         fi
-        if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-            dpkg-maintscript-helper rm_conffile \
-                /etc/defoma/hints/t1-teams.hints 4.14 -- "$@"
-        fi
         ;;
 
     abort-upgrade)

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

Reply via email to