summaryrefslogtreecommitdiff
path: root/debian/xfonts-traditional.postinst
blob: 6ee2e43220634d65f5e75bce91571ca44fd21939 (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
#!/bin/sh
set -e

. /usr/share/debconf/confmodule

#DEBHELPER#

aliasfile=/etc/X11/fonts/misc/xfonts-base.alias

check_aliasfile () {
	if ! test -f $aliasfile; then return; fi
	if test -e $aliasfile.not-trad; then return; fi

	perl -pe '
 s/^(fixed\s+)\-misc\-(fixed-medium-r-semicondensed)/$1-trad-$2/
		' <$aliasfile >$aliasfile.trad
	if cmp -s $aliasfile $aliasfile.trad; then
		rm $aliasfile.trad
		return
	fi
	db_get xfonts-traditional/remap-fixed
	if [ $RET != true ]; then return; fi

	echo 'Installing traditional variant of "fixed"...'
	ln $aliasfile $aliasfile.not-trad
	mv -f $aliasfile.trad $aliasfile

	update-fonts-alias misc

	db_set xfonts-traditional/remap-fixed false
	# only ever do this once
}

db_get xfonts-traditional/generate
if [ "$RET" = true ]; then

	update-xfonts-traditional --update

	check_aliasfile

fi