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
|
# common.functions.postrm start
# $Id: common.functions.postrm 3943 2009-05-22 12:11:09Z preining $
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: #
|