chiark / gitweb /
packaging fixes
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 9 Jan 2012 22:00:23 +0000 (22:00 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 9 Jan 2012 22:00:23 +0000 (22:00 +0000)
debian/xfonts-traditional.postinst
debian/xfonts-traditional.postrm
debian/xfonts-traditional.prerm
update-xfonts-traditional

index 6e05d676d31d13111127c12408f97173ee5f85fc..64aef5f9ff27899fa0bd17a5685986bec194ad85 100755 (executable)
@@ -2,14 +2,14 @@
 set -e
 
 . /usr/share/debconf/confmodule
+aliasfile=/etc/X11/fonts/misc/xfonts-base.alias
 
 check_aliasfile () {
-       aliasfile=/etc/X11/fonts/misc/xfonts-base.alias
        if ! test -f $aliasfile; then return; fi
        if test -e $aliasfile.not-trad; then return; fi
 
        perl -pe '
- s/^(fixed\s+)\-misc\-(fixed-medium-r-semicondensed)/$1-trad-$2$/
+ s/^(fixed\s+)\-misc\-(fixed-medium-r-semicondensed)/$1-trad-$2/
                ' <$aliasfile >$aliasfile.trad
        if cmp -s $aliasfile $aliasfile.trad; then
                rm $aliasfile.trad
@@ -18,9 +18,12 @@ check_aliasfile () {
        db_get xfonts-traditional/remap-fixed
        if [ $RET != true ]; then return; fi
 
+       echo 'Installing traditional variant of "fixed"...'
        ln $aliasfile $aliasfile.not-trad
        mv -f $aliasfile.trad $aliasfile
 
+       update-fonts-alias misc
+
        db_put xfonts-traditional/remap-fixed false
        # only ever do this once
 }
index 303188e498f6c092dd6f91e41fcddde5811ce18f..e9972f3e9d71430c12a40ff88b7eebb2ea348946 100755 (executable)
@@ -1,12 +1,12 @@
 #!/bin/sh
 set -e
-. /usr/share/debconf/confmodule
 
 #DEBHELPER#
 
+aliasfile=/etc/X11/fonts/misc/xfonts-base.alias
+
 case "$1" in
 purge)
-       aliasfile=/etc/X11/fonts/misc/xfonts-base.alias
        rm -f $aliasfile.trad
        ;;
 esac
index 8b1ed6bc91d1c157bf7e50e5d99ce09fe74bc9a1..71f3f5d2bee3b9b061be02e7ea0af4247f2e862f 100755 (executable)
@@ -2,6 +2,7 @@
 set -e
 
 . /usr/share/debconf/confmodule
+aliasfile=/etc/X11/fonts/misc/xfonts-base.alias
 
 case "$1" in
 
@@ -9,36 +10,43 @@ remove)
 
        echo 'Checking that "fixed" is not from xfonts-traditional...'
 
-       if grep '^fixed[         ][      ]*-trad-'; then
+       if grep '^fixed[         ][      ]*-trad-' $aliasfile \
+           /usr/share/fonts/X11/misc/fonts.alias; then
                cat >&2 <<'END'
+
 Removing xfonts-traditional would break your X server by removing "fixed".
 
 You should not remove xfonts-traditional while "fixed" refers to one
 of its fonts.  You probably want to check the differences between
 /etc/X11/fonts/misc/xfonts-base.alias and xfonts-base.alias.not-trad,
-and probably replace the former with the latter, and retry the removal.
+reconcile any changes, and then run "update-fonts-alias misc".
+After that you can retry the removal.
 
 END
                printf 'Continue anyway ? [n/y] '
-               read x
+               read x </dev/tty
                case "$x" in
                y*|Y*)  ;;
                *)      exit 1 ;;
                esac
        fi
 
-       find /usr/share/fonts/X11 /usr/local/share/fonts/X11 \
-                  -type f \
-               \( -name xfonts-traditional.log -o \
-                  -name xfonts-traditional.done -o 
-                  -name xfonts-traditional.done.new -o 
-                  -name trad--\*.pcf.gz.new \) \
-               -print0 | xargs -0r rm --
-
-       find /usr/share/fonts/X11 /usr/local/share/fonts/X11 \
-                  -type f \
-                  -name trad--\*.pcf.gz \
-               -print0 | xargs -0r rm --
+       for d in /usr/share/fonts/X11 /usr/local/share/fonts/X11; do
+               if ! test -e "$d"; then continue; fi
+
+               find "$d" \
+                          -type f \
+                       \( -name xfonts-traditional.log -o \
+                          -name xfonts-traditional.done -o \
+                          -name xfonts-traditional.done.new -o  \
+                          -name trad--\*.pcf.gz.new \) \
+                       -print0 | xargs -0r rm --
+
+               find "$d" \
+                          -type f \
+                          -name trad--\*.pcf.gz \
+                       -print0 | xargs -0r rm --
+       done
 
        ;;
 
index 839cc1827cf678d595e3a43d1b8e7d6f6ad8c365..e2fb14fb762f90a696bb07a60dcd647151a6b1e4 100755 (executable)
@@ -231,8 +231,7 @@ sub processfontdir ($) {
     my $olddone = do "$fontdir/$donefile";
     if (!$olddone) {
        die "$fontdir $! $@ " unless $!==&ENOENT;
-    }
-    if ($olddone && $olddone->{''} ne $foundryinfo) {
+    } elsif ($olddone->{''} ne $foundryinfo) {
        our $repro_reported;
        print $reportfh "reprocessing fonts (rules updated)\n" or die $!
            unless $repro_reported++;