summaryrefslogtreecommitdiff
path: root/print/texlive-tetex/files/format-deinstall.tmpl
blob: 7d0c2e765b1a09604b159edb1a2ba1b909cd7f2d (plain)
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
# $NetBSD: format-deinstall.tmpl,v 1.3 2010/01/28 22:37:33 minskim Exp $
#
# Delete format files.
#

FMTUTIL_CNF=${PKG_SYSCONFBASE}/texmf/web2c/fmtutil.cnf

case ${STAGE} in
DEINSTALL)
	format_names="@FORMAT_NAMES@"
	for f in $format_names ; do
		@CAT@ @PREFIX@/share/texmf/fmtutil/format.$f.cnf |
		@GREP@ "^[^#]" |
		while read format engine junk; do
		  ${GREP} -v "^${format}[[:space:]][[:space:]]*${engine}[[:space:]]" ${FMTUTIL_CNF} > \
			${FMTUTIL_CNF}.tmp &&
		  ${MV} ${FMTUTIL_CNF}.tmp ${FMTUTIL_CNF}
		  case "$engine" in
		    mpost)
		      if [ "$format" = "mpost" ]; then
		        fmtfile="mp*.mem"
		      else
		        fmtfile="$format.mem"
		      fi
		      texengine=metapost
		      ;;
		    mf*)
		      fmtfile="$format.base"
		      texengine=metafont
		      ;;
		    *)
		      fmtfile="$format.fmt"
		      texengine=$engine
		      ;;
		  esac
			@RM@ -f @VARBASE@/lib/texmf/web2c/$texengine/$fmtfile
			@RM@ -f @VARBASE@/lib/texmf/web2c/$texengine/$format.log
		done
	done
	@FIND@ -d @VARBASE@/lib/texmf -type d -empty -exec @RMDIR@ {} \;
        ;;
*)
	;;
esac