chiark / gitweb /
fix postinst bug
[xfonts-traditional] / debian / xfonts-traditional.postinst
CommitLineData
12fa1ef8
IJ
1#!/bin/sh
2set -e
4ff07717 3
12fa1ef8 4. /usr/share/debconf/confmodule
b9008d6d 5aliasfile=/etc/X11/fonts/misc/xfonts-base.alias
4ff07717
IJ
6
7check_aliasfile () {
4ff07717
IJ
8 if ! test -f $aliasfile; then return; fi
9 if test -e $aliasfile.not-trad; then return; fi
10
11 perl -pe '
b9008d6d 12 s/^(fixed\s+)\-misc\-(fixed-medium-r-semicondensed)/$1-trad-$2/
4ff07717
IJ
13 ' <$aliasfile >$aliasfile.trad
14 if cmp -s $aliasfile $aliasfile.trad; then
15 rm $aliasfile.trad
16 return
17 fi
18 db_get xfonts-traditional/remap-fixed
19 if [ $RET != true ]; then return; fi
20
b9008d6d 21 echo 'Installing traditional variant of "fixed"...'
4ff07717
IJ
22 ln $aliasfile $aliasfile.not-trad
23 mv -f $aliasfile.trad $aliasfile
24
b9008d6d
IJ
25 update-fonts-alias misc
26
3b5a8fd8 27 db_set xfonts-traditional/remap-fixed false
4ff07717
IJ
28 # only ever do this once
29}
30
31db_get xfonts-traditional/generate
32if [ "$RET" = true ]; then
33
34 update-xfonts-traditional --update
35
36 check_aliasfile
37
38fi