3 # preinst script for the Debian GNU/Linux lilypond package
4 # by Anthony Fok <foka@debian.org>
5 # This is free software; see the GNU General Public Licence
6 # version 2 or later for copying conditions. There is NO warranty.
7 # Last modified: Tue, 11 Nov 1997 01:25:15 -0700
11 font_typeface=lilypond
12 std_TEXMF=/usr/lib/texmf
14 if [ "`which kpsetool`" ]; then
15 TEXMF=`kpsetool -v '$TEXMF'`
17 : ${TEXMF:=$std_TEXMF}
24 # Prior to the Debian release of the lilypond_0.1.29-1 package,
25 # LilyPond's fonts were not added to teTeX's special.map,
26 # and so the automatically generated TFM and PK files were placed
27 # in the wrong directory under /var/spool/texmf (or $MT_DESTROOT).
28 # So, now I have to clean up after my mess to make sure those fonts
29 # do not interfere with the new fonts! :)
31 : ${MAKETEXDIR=$TEXMF/maketex}
32 test -r $MAKETEXDIR/maketex.site && . $MAKETEXDIR/maketex.site
33 : ${MT_DESTROOT=$TEXMF/fonts}
35 # Remove the "stray" old LilyPond TFM and PK files.
38 find $MT_DESTROOT/$i \( -name 'dyn10.*'$i -o -name 'font-en-tja*.*'$i \
39 -o -name 'vette-beams*.*'$i \) -print0 |
40 xargs --null --no-run-if-empty rm -f
43 # Remove empty directories.
44 # A note to myself or the future maintainer:
45 # Why the "for i in 1 2" loop? Well, it seems that either
46 # "find some_path -depth" isn't working properly, or I
47 # (Anthony) don't know its proper behaviour. Please look
48 # into it and see if this ugly hack could be removed.
51 find $MT_DESTROOT/tfm -depth -mindepth 1 -type d -empty -print0 2> /dev/null |
52 xargs -0r --null --no-run-if-empty rmdir
53 find $MT_DESTROOT/pk -depth -mindepth 2 -type d -empty -print0 2> /dev/null |
54 xargs -0r --null --no-run-if-empty rmdir
62 echo "$0 called with unknown argument \`$1'" >&2