File: prerm

package info (click to toggle)
jadetex 3.12-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,080 kB
  • ctags: 93
  • sloc: xml: 736; sh: 153; makefile: 125
file content (41 lines) | stat: -rw-r--r-- 918 bytes parent folder | download
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
#!/bin/bash
# derived from tetex-base.postrm

set -e

# clear environment
TETEXDIR=
TEXMF=
TEXINPUTS=

ETC_CONFIG=/etc/texmf/jadetex
FMTDIR=/etc/texmf/fmt.d

if [ "$1" = "remove" ]; then
    # remove the fmt files created at postinst
    JADETEXFMT=$(kpsewhich jadetex.fmt) || true
    PDFJADETEXFMT=$(kpsewhich pdfjadetex.fmt) || true
    rm -f $JADETEXFMT $PDFJADETEXFMT

    # remove the logs created as a sideeffect
    WEB2CDIR=$(dirname $JADETEXFMT) || true
    rm -f $WEB2CDIR/jadetex.log $WEB2CDIR/pdfjadetex.log

    # disable the fmt.d bit and recreate fmtutil.cnf
    if [ -f ${FMTDIR}/40jadetex.cnf ]; then
        mv ${FMTDIR}/40jadetex.cnf ${FMTDIR}/40jadetex.cnf.disable
    fi
    update-fmtutil
fi

# the upgrade case will be handled in postinst; no need to run it twice
if [ "$1" != "upgrade" ]; then
    if command -v texhash >/dev/null 2>&1; then  
	texhash || true
    fi
fi

#DEBHELPER#

exit 0