3
# preinst script for the tipa package
4
# GNU Copyright (c) 2007 Rafael Labossiere
6
# Remove a no-longer used conffile
7
# (code taken from http://wiki.debian.org/DpkgConffileHandling)
12
if [ -e "$CONFFILE" ]; then
13
md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
14
old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE's/.* //p\"`"
15
if [ "$md5sum" != "$old_md5sum" ]; then
16
echo "Obsolete conffile $CONFFILE has been modified by you."
17
echo "Saving as $CONFFILE.dpkg-bak ..."
18
mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
20
echo "Removing obsolete conffile $CONFFILE ..."
27
# we have to move the map and dvips config file into /u/s/texmf
28
# but want to preserve changes done by the user!
31
dpkg-query -f'${Conffiles}' --show tipa | grep $1 | cut -f 3 -d ' '
38
oldmd5sum=`dpkg_md5sum $oldfile`
40
if ! [ -r $oldfile ] ; then
44
newmd5sum=`md5sum $oldfile | cut -d ' ' -f 1`
45
if [ "$newmd5sum" = "$oldmd5sum" ] ; then
46
echo "Removing obsolete, unchanged conffile $oldfile"
49
if [ "X$newloc" = "X" ] ; then
50
echo "Conffile $oldfile was changed, leaving it at the same place"
52
echo "Conffile $oldfile was changed, moving it to new location $newloc"
57
test -d $oldloc && rmdir --ignore-fail-on-non-empty $oldloc || true
65
config_move /etc/texmf/dvips/tipa.map /etc/texmf/fonts/map/dvips
66
if dpkg --compare-versions "$2" le 2:1.3-4 ; then
67
rm_conffile tipa /etc/texmf/updmap.d/10tipa.cfg
75
echo "preinst called with unknown argument \`$1'" >&2