File: postrm

package info (click to toggle)
xmltex 1.9-10
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 328 kB
  • ctags: 24
  • sloc: xml: 867; sh: 165; makefile: 52
file content (58 lines) | stat: -rw-r--r-- 1,330 bytes parent folder | download | duplicates (2)
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
#!/bin/bash
# postrm script for xmltex
#
# Some code cribbed from jadetex prerm
#
# see: dh_installdeb(1)

set -e

FMTDIR=/etc/texmf/fmt.d
TEXMFDIR=/etc/texmf/texmf.d

case "$1" in
    remove)
	# remove fmt and efmt files
	XMLTEXFMT=$(kpsewhich xmltex.efmt xmltex.fmt) || true
	PDFXMLTEXFMT=$(kpsewhich pdfxmltex.efmt pdfxmltex.fmt) || true
	LOGDIR=$(dirname $(kpsewhich xmltex.efmt xmltex.fmt|head -n 1)) || true
	rm -f $XMLTEXFMT $PDFXMLTEXFMT

	# remove fmt file logs
	rm -f $LOGDIR/xmltex.log $LOGDIR/pdfxmltex.log

	# disable conf files
	if [ -f ${FMTDIR}/40xmltex.cnf ]; then
	    mv -f ${FMTDIR}/40xmltex.cnf ${FMTDIR}/40xmltex.cnf.disable
	fi
	update-fmtutil
	if [ -f ${TEXMFDIR}/20xmltex.cnf ]; then
            mv -f ${TEXMFDIR}/20xmltex.cnf ${TEXMFDIR}/20xmltex.cnf.disable
	fi
	update-texmf
        ;;
    purge)
        rm -f ${TEXMFDIR}/20xmltex.cnf.disable
        rm -f ${FMTDIR}/40xmltex.cnf.disable
        rm -rf /etc/texmf/xmltex || true
        ;;
    upgrade)
        if command -v texhash >/dev/null 2>&1; then  
            texhash || true
        fi
	;;
    failed-upgrade|deconfigure)
        ;;
    *)
        echo "postrm called with unknown argument \`$1'" >&2
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0