preinst is in fonts-ipafont-gothic 00303-13ubuntu1.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | #!/bin/sh
#
set -e
OTF_VERSION=00302-4
OTF_ALT_NAME=otf-japanese-gothic
OTF_FONT_ENTRY=/usr/share/fonts/opentype/ipafont/ipag.otf
CHECK_VERSION=00303-5
OLD_ALT_NAME=ttf-japanese-gothic
FONT_ENTRY=$OTF_FONT_ENTRY
OLD_FONT_ENTRY=/usr/share/fonts/opentype/ipafont/ipag.ttf
case "$1" in
install|upgrade)
if dpkg --compare-versions "$2" lt-nl "$OTF_VERSION"; then
# remove old alternative otf symlinks.
update-alternatives --remove $OTF_ALT_NAME.otf $OTF_FONT_ENTRY
fi
if dpkg --compare-versions "$2" lt-nl "$CHECK_VERSION"; then
if [ -d /usr/share/fonts/opentype/fonts-ipafont-gothic ]; then
update-alternatives --remove $OLD_ALT_NAME.ttf /usr/share/fonts/opentype/fonts-ipafont-gothic/ipag.ttf
else
update-alternatives --remove $OLD_ALT_NAME.ttf $FONT_ENTRY
fi
fi
# do this on new installations, too, as these could be "upgrades"
# from otf-ipafont-gothic
if dpkg --compare-versions "$2" lt "00303-10.1~" ; then
update-alternatives --remove $OLD_ALT_NAME.ttf $OLD_FONT_ENTRY
fi
esac
exit 0
|