preinst is in latex209-bin 25.mar.1992-15.
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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | #!/bin/sh -e
#
# latex209-bin preinst script
#
#
# if the config file from previous versions is present and matches the
# md5sum, add the new dh_installtex header to make sure that no debconf
# questions are asked, otherwise just let the user decide.
#
cnffile=/etc/texmf/fmt.d/25latex209.cnf
bakfile=/etc/texmf/fmt.d/25latex209.bak
correctmd=7c958ab4f8bf7a0080bc46c48d137bd1
fix_it_up=0
case "$1" in
upgrade|install)
old_version=$2
if [ -n "$old_version" ] && dpkg --compare-versions "$old_version" lt 25.mar.1992-12.6 ; then
if [ -r $cnffile ] ; then
# if an old conffile is found and matches the md5 sum, we fix it up
# otherwise we leave it alone
oldmd=`md5sum $cnffile | sed -e 's/ .*//'`
if [ "$oldmd" = $correctmd ] ; then
fix_it_up=1
fi
elif [ -r $bakfile ] ; then
# if the backup file is found, and matches the md5 sum, we simply delete
# it, as it will be reinstatiated by dpkg
oldmd=`md5sum $bakfile | sed -e 's/ .*//'`
if [ "$oldmd" = $correctmd ] ; then
rm $bakfile
else
mv $bakfile $cnffile
fi
fi
if [ $fix_it_up = 1 ] ; then
echo '# 25latex209.cnf
# You can change/add entries to this file and changes will be preserved
# over upgrades, even if you have removed the main package prior
# (not if you purged it). You should leave the following pseudo comment
# present in the file!
# -_- DebPkgProvidedMaps -_-
#
#
# LaTeX 2.09
#
# format engine pattern-file arguments
latex209 tex - latex209.ini
' > $cnffile
fi
fi
;;
esac
exit 0
|