]> git.donarmstrong.com Git - lilypond.git/blob - debian/preinst
partial: 1.0.1.jcn
[lilypond.git] / debian / preinst
1 #!/bin/sh
2 #
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:  Mon,  5 Jan 1998 18:39:30 -0700
8
9 set -e
10
11 package=lilypond
12 font_supplier=public
13 font_typeface=lilypond
14 std_TEXMF=/usr/lib/texmf
15
16 #DEBHELPER#
17
18 if [ "`which kpsetool`" ]; then
19     TEXMF=`kpsetool -v '$TEXMF'`
20 fi
21 : ${TEXMF:=$std_TEXMF}
22
23
24 case "$1" in
25
26     install | upgrade)
27
28         # Prior to the Debian release of the lilypond_0.1.29-1 package,
29         # LilyPond's fonts were not added to teTeX's special.map,
30         # and so the automatically generated TFM and PK files were placed
31         # in the wrong directory under /var/spool/texmf (or $MT_DESTROOT).
32         # So, now I have to clean up after my mess to make sure those fonts
33         # do not interfere with the new fonts!  :)
34
35         : ${MAKETEXDIR=$TEXMF/maketex}
36         test -r $MAKETEXDIR/maketex.site && . $MAKETEXDIR/maketex.site
37         : ${MT_DESTROOT=$TEXMF/fonts}
38
39         # Remove the "stray" old LilyPond TFM and PK files.
40         for i in tfm pk
41         do
42             find $MT_DESTROOT/$i \( -name 'dyn10.*'$i -o -name 'font-en-tja*.*'$i \
43                 -o -name 'vette-beams*.*'$i \) -print0 |
44                 xargs --null --no-run-if-empty rm -f
45         done
46
47         # Remove empty directories.
48         # A note to myself or the future maintainer:
49         #   Why the "for i in 1 2" loop?  Well, it seems that either
50         #   "find some_path -depth" isn't working properly, or I
51         #   (Anthony) don't know its proper behaviour.  Please look
52         #   into it and see if this ugly hack could be removed.
53         for i in 1 2
54         do
55             find $MT_DESTROOT/tfm -depth -mindepth 1 -type d -empty -print0 2> /dev/null |
56                 xargs -0r --null --no-run-if-empty rmdir
57             find $MT_DESTROOT/pk -depth -mindepth 2 -type d -empty -print0 2> /dev/null |
58                 xargs -0r --null --no-run-if-empty rmdir
59         done
60     ;;
61
62     abort-upgrade)
63     ;;
64
65     *)
66         echo "$0 called with unknown argument \`$1'" >&2
67         exit 0
68     ;;
69
70 esac