]> git.donarmstrong.com Git - lilypond.git/blobdiff - debian/preinst
apply Julian's patch to fix install-info warnings
[lilypond.git] / debian / preinst
index eba9114d562fc95a58ef8755b929e9db42a95238..bbaba25e129bc89a1768a2c90268d05fe925959b 100644 (file)
@@ -1,66 +1,49 @@
-#!/bin/bash -e
+#!/bin/sh
 #
 # preinst script for the Debian GNU/Linux lilypond package
-#   by Anthony Fok <foka@gpu.srv.ualberta.ca>
+#   by Anthony Fok <foka@debian.org>
 #   This is free software; see the GNU General Public Licence
 #   version 2 or later for copying conditions.  There is NO warranty.
-#   Last modified:  Tue, 11 Nov 1997 01:25:15 -0700
+#   Last modified:  Mon,  5 Apr 1999 20:30:12 -0600
+
+set -e
 
 package=lilypond
 font_supplier=public
 font_typeface=lilypond
-std_TEXMF=/usr/lib/texmf
-
-if [ "`which kpsetool`" ]; then
-    TEXMF=`kpsetool -v '$TEXMF'`
-fi
-: ${TEXMF:=$std_TEXMF}
+std_TEXMFMAIN=/usr/share/texmf
+std_VARTEXFONTS=/var/spool/texmf
 
+#DEBHELPER#
 
-case "$1" in
-
-    install | upgrade)
+TEXMFMAIN=`kpsewhich -expand-var '$TEXMFMAIN'`
+: ${TEXMFMAIN:=$std_TEXMFMAIN}
+VARTEXFONTS=`kpsewhich -expand-var '$VARTEXFONTS'`
+: ${VARTEXFONTS=$std_VARTEXFONTS}
 
-       # Prior to the Debian release of the lilypond_0.1.29-1 package,
-       # LilyPond's fonts were not added to teTeX's special.map,
-       # and so the automatically generated TFM and PK files were placed
-       # in the wrong directory under /var/spool/texmf (or $MT_DESTROOT).
-       # So, now I have to clean up after my mess to make sure those fonts
-       # do not interfere with the new fonts!  :)
+LILYTEXINPUTS=$TEXMFMAIN/tex/$package
+LILYMFINPUTS=$TEXMFMAIN/fonts/source/$font_supplier/$font_typeface
 
-       : ${MAKETEXDIR=$TEXMF/maketex}
-       test -r $MAKETEXDIR/maketex.site && . $MAKETEXDIR/maketex.site
-       : ${MT_DESTROOT=$TEXMF/fonts}
-
-       # Remove the "stray" old LilyPond TFM and PK files.
-       for i in tfm pk
-       do
-           find $MT_DESTROOT/$i \( -name 'dyn10.*'$i -o -name 'font-en-tja*.*'$i \
-               -o -name 'vette-beams*.*'$i \) -print0 |
-               xargs --null --no-run-if-empty rm -f
-       done
-
-       # Remove empty directories.
-       # A note to myself or the future maintainer:
-       #   Why the "for i in 1 2" loop?  Well, it seems that either
-       #   "find some_path -depth" isn't working properly, or I
-       #   (Anthony) don't know its proper behaviour.  Please look
-       #   into it and see if this ugly hack could be removed.
-       for i in 1 2
-       do
-           find $MT_DESTROOT/tfm -depth -mindepth 1 -type d -empty -print0 2> /dev/null |
-               xargs -0r --null --no-run-if-empty rmdir
-           find $MT_DESTROOT/pk -depth -mindepth 2 -type d -empty -print0 2> /dev/null |
-               xargs -0r --null --no-run-if-empty rmdir
-       done
+case "$1" in
+    install|upgrade)
+       # Clear out the old TFM and PK files in case the fonts were
+       # left-over from previous installations
+       rm -rf $VARTEXFONTS/tfm/$font_supplier/$font_typeface
+       rm -rf $VARTEXFONTS/pk/*/$font_supplier/$font_typeface
+
+       # Fix a silly bug in Debian's lilypond 1.0.17-1.  :-)
+       if [ "$2" = "1.0.17-1" ]; then
+           rm -rf $VARTEXFONTS/tfm/$font_supplier/mf
+           rm -rf $VARTEXFONTS/pk/*/$font_supplier/mf
+       fi
     ;;
 
     abort-upgrade)
     ;;
 
     *)
-        echo "$0 called with unknown argument \`$1'" >&2
-        exit 0
+       echo "$0 called with unknown argument \`$1'" >&2
+       exit 0
     ;;
 
 esac