postrm is in texlive-base 2009-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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | #!/bin/sh -e
# common.functions.postrm start
# $Id: common.functions.postrm 2876 2007-05-22 08:12:07Z frank $
check_move_back ()
{
orig="$1"
new="$2"
if [ -r "$new" ] ; then
mkdir -p $(dirname "$orig")
mv "$new" "$orig"
fi
}
handle_config_file_postrm()
{
cfgfile="$1"
action="$2"
version="$3"
case "$action" in
abort-upgrade)
if dpkg --compare-versions "$version" ge 2007; then
return 0
fi
;;
*)
return 0
;;
esac
conf_relpath=${cfgfile#/etc/texmf/}
conf_oldpath="/etc/texmf/texlive/$conf_relpath"
case "$cfgfile" in
/etc/texmf/dvips/config/*)
# special case for dvips config
conf_oldpath="/etc/texmf/texlive/dvips/${conf_oldpath#/etc/texmf/dvips/config}"
;;
# files which were only present in tetex
/etc/texmf/texdoctk/texdoctk.dat)
conf_oldpath="/etc/texdoctk/texdoctk.dat"
;;
/etc/texmf/xdvi/xdvi.cfg)
# old tetex version
if [ -r "$cfgfile" ]; then
cp $cfgfile /etc/texmf/xdvi.cfg
fi
# old texlive version
conf_oldpath="/etc/texmf/texlive/xdvi.cfg"
esac
check_move_back $conf_oldpath $cfgfile
}
# common.functions.postrm end
# Local Variables:
# mode: shell-script
# End:
# vim:set expandtab: #
handle_config_file_postrm /etc/texmf/dvipdfm/config/config $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/alt-rule.pro $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/canonex.cfg $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/config.bakoma $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/config.canonex $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/config.cx $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/config.deskjet $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/config.dvired $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/config.epson $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/config.ibmvga $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/config.ljfour $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/config.luc $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/config.mbn $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/config.mga $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/config.mirrorprint $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/config.ot2 $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/config.qms $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/config.toshiba $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/config.unms $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/config.xyp $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/cx.cfg $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/deskjet.cfg $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/dfaxhigh.cfg $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/dvired.cfg $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/epson.cfg $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/ibmvga.cfg $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/ljfour.cfg $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/qms.cfg $1 $2
handle_config_file_postrm /etc/texmf/dvips/config/toshiba.cfg $1 $2
handle_config_file_postrm /etc/texmf/xdvi/xdvi.cfg $1 $2
handle_config_file_postrm /etc/texmf/texdoc/texdoc.cnf $1 $2
handle_config_file_postrm /etc/texmf/texdoctk/texdocrc.defaults $1 $2
# Automatically added by dh_installmenu
if [ -x "`which update-menus 2>/dev/null`" ]; then update-menus ; fi
# End automatically added section
# Automatically added by dh_installtex
##
## postrm-tex
##
## postrm snippets for registering hyphenation patterns, font maps, and formats
##
## Authors:
## Florent Rougon <f.rougon@free.fr>
## Norbert Preining <preining@logic.at>
##
#
dhit_call_update_texmf_config ()
{
if which update-texmf-config >/dev/null; then
update-texmf-config $*
else
echo "update-texmf-config not present: is tex-common installed?" >&2
fi
}
dhit_check_run_without_errors ()
{
silent=0
if [ "$1" = "-silent" ] ; then
silent=1
shift
fi
if which "$1" >/dev/null; then
tempfile=$(mktemp -p /tmp checkrun.XXXXXXXX)
if [ $silent = 0 ] ; then
printf "Running '$*'.\nThis may take some time..."
fi
set +e
if "$@" > $tempfile 2>&1 ; then
rm -f $tempfile
[ $silent = 0 ] && echo " done."
else
echo
echo "$* failed. Output has been stored in"
echo "$tempfile"
echo "If tex-common is not configured you can ignore this error" \
"message!"
echo "Otherwise, please include this file if you report a bug."
echo
fi
set -e
fi
return 0
}
case "$1" in
remove|disappear)
dhit_check_run_without_errors -silent update-updmap --quiet
dhit_check_run_without_errors -silent update-language
dhit_check_run_without_errors -silent update-fmtutil
for i in map hyphen format lsrfull ; do
if [ "$i" = lsr ] ; then
dhit_call_update_texmf_config lsr
fi
if [ "$i" = lsrfull ] ; then
dhit_call_update_texmf_config lsrfull
fi
if [ "$i" = map ] ; then
dhit_call_update_texmf_config map
fi
if [ "$i" = allformats ] ; then
for fmt in pdftex/etex etex pdftex/pdfetex pdfetex luatex/luatex luatex luatex/dviluatex dviluatex pdftex/pdftex pdftex metafont/mf mf tex/tex tex ; do
rm -f /var/lib/texmf/web2c/$fmt.*
done
fi
if [ "$i" = format ] ; then
for fmt in pdftex/etex etex pdftex/pdfetex pdfetex luatex/luatex luatex luatex/dviluatex dviluatex pdftex/pdftex pdftex metafont/mf mf tex/tex tex ; do
rm -f /var/lib/texmf/web2c/$fmt.*
done
fi
if [ "$i" = hyphen ] ; then
dhit_call_update_texmf_config hyphen
fi
done
;;
purge|upgrade|failed-upgrade|abort-upgrade|abort-install)
;;
*)
echo "postrm called with unknown argument '$1'" >&2
exit 1
;;
esac
# End automatically added section
# Automatically added by dh_installmime
if which update-mime >/dev/null 2>&1; then update-mime; fi
# End automatically added section
# texlive-base.postrm.post
# written 2010 by Frank K�ster frank@debian.org. this code is probably
# not copyrightable. If it is, it may be freely used, distributed
# and/or modified.
purge_file () {
local conffile
conffile="$1"
for ext in $PURGE_EXTENSIONS; do
rm -f "${conffile}.${ext}"
done
rm -f "${conffile}"
}
purge_ucf_file () {
local conffile
conffile="$1"
purge_file $conffile
if [ -x /usr/bin/ucf ]; then
ucf --purge "${conffile}"
fi
if [ -x /usr/bin/ucfr ]; then
ucfr --purge tex-common "${conffile}"
fi
}
PURGE_EXTENSIONS="ucf-dist ucf-new"
UCF_FILES="\
dvips/config/config.ps \
tex/generic/config/pdftexconfig.tex \
dvipdfmx/dvipdfmx.cfg \
xdvi/XDvi"
case $1 in
purge)
for file in $UCF_FILES; do
purge_ucf_file /etc/texmf/$file
done
;;
esac
exit 0
|