File: tetex-extra.postinst

package info (click to toggle)
tetex-base 2.0.2c-8
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 154,924 kB
  • ctags: 4,018
  • sloc: perl: 5,721; sh: 1,250; makefile: 310; lisp: 289; python: 251
file content (60 lines) | stat: -rw-r--r-- 1,743 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh

set -e

PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
envvars="
AFMFONTS BIBINPUTS BSTINPUTS DVILJFONTS DVIPSFONTS DVIPSHEADERS GFFONTS
GLYPHFONTS INDEXSTYLE MFBASES MFINPUTS MFPOOL MFTINPUTS MPINPUTS MPMEMS
MPPOOL MPSUPPORT OCPINPUTS OFMFONTS OPLFONTS OTPINPUTS OVFFONTS OVPFONTS
PKFONTS PSHEADERS T1FONTS T1INPUTS TEXBIB TEXCONFIG TEXDOCS TEXFONTMAPS
TEXFONTS TEXFORMATS TEXINDEXSTYLE TEXINPUTS TEXMFCNF TEXMFDBS TEXMFINI
TEXPICTS TEXPKS TEXPOOL TEXPSHEADERS TEXSOURCES TFMFONTS TRFONTS VFFONTS
XDVIFONTS XDVIVFS TEXMF TETEXDIR
"
for i in $envvars; do
    unset $i || true
done
#unset TETEXDIR || true
#unset TEXMF || true
#unset TEXINPUTS || true
VUMAPC=/var/lib/texmf/web2c/updmap.cfg
MKTMPDIR=/tmp
TEXINIT_P="/usr/bin/fmtutil"
umask 022

# Use debconf.
. /usr/share/debconf/confmodule || exit
db_version 2.0

if [ x"$1" = xconfigure ]
then
    # handling of ucf-managed configuration files
    /usr/share/tetex-base/setup-ucf -extra
    if [ -e /usr/bin/fmtutil ] && \
        kpsewhich --format='web2c files' fmtutil.cnf >/dev/null && \
	kpsewhich --expand-var='$TEXMF' | grep -q "/usr/share/texmf"  2> /dev/null
    then
      tempfile=`mktemp -p $MKTMPDIR tetex-extra.postinst.XXXXXXXX`
      echo "Running initex. This may take some time. ..."
      if $TEXINIT_P --missing > $tempfile; then
	rm -f $tempfile
      else
	echo "Running fmtutil failed."
	exit 1
      fi
    fi
    if [ -x /usr/bin/updmap -a -f ${VUMAPC} -a -x /usr/bin/kpsewhich ]; then
      tempfile=`mktemp -p $MKTMPDIR tetex-extra.updmap.XXXXXXXX`
      echo "Running updmap. This may take some time. ..."
      if updmap 2> $tempfile; then
	rm -f $tempfile
      else
	echo "Running updmap failed."
	exit 1
      fi
      echo
    fi
fi

#DEBHELPER#