Debian Codegraph @

debian/fonts-ipafont-gothic.preinst

raw
1 #!/bin/sh
2 #
3
4 set -e
5
6 OTF_VERSION=00302-4
7 OTF_ALT_NAME=otf-japanese-gothic
8 OTF_FONT_ENTRY=/usr/share/fonts/opentype/ipafont/ipag.otf
9
10 CHECK_VERSION=00303-5
11 OLD_ALT_NAME=ttf-japanese-gothic
12 FONT_ENTRY=$OTF_FONT_ENTRY
13 OLD_FONT_ENTRY=/usr/share/fonts/opentype/ipafont/ipag.ttf
14
15
16 case "$1" in
17 install|upgrade)
18 if dpkg --compare-versions "$2" lt-nl "$OTF_VERSION"; then
19 # remove old alternative otf symlinks.
20 update-alternatives --remove $OTF_ALT_NAME.otf $OTF_FONT_ENTRY
21 fi
22
23 if dpkg --compare-versions "$2" lt-nl "$CHECK_VERSION"; then
24 if [ -d /usr/share/fonts/opentype/fonts-ipafont-gothic ]; then
25 update-alternatives --remove $OLD_ALT_NAME.ttf /usr/share/fonts/opentype/fonts-ipafont-gothic/ipag.ttf
26 else
27 update-alternatives --remove $OLD_ALT_NAME.ttf $FONT_ENTRY
28 fi
29 fi
30
31 # do this on new installations, too, as these could be "upgrades"
32 # from otf-ipafont-gothic
33 if dpkg --compare-versions "$2" lt "00303-10.1~" ; then
34 update-alternatives --remove $OLD_ALT_NAME.ttf $OLD_FONT_ENTRY
35 fi
36
37 esac
38
39 #DEBHELPER#
40
41 exit 0