chiark / gitweb /
wip new config
[xfonts-traditional.git] / debian / xfonts-traditional.prerm
1 #!/bin/sh
2 set -e
3
4 . /usr/share/debconf/confmodule
5
6 #DEBHELPER#
7
8 aliasfile=/etc/X11/fonts/misc/xfonts-base.alias
9
10 case "$1" in
11
12 remove)
13
14         echo 'Checking that "fixed" is not from xfonts-traditional...'
15
16         if grep '^fixed[         ][      ]*-trad-' $aliasfile \
17             /usr/share/fonts/X11/misc/fonts.alias; then
18                 cat >&2 <<'END'
19
20 Removing xfonts-traditional would break your X server by removing "fixed".
21
22 You should not remove xfonts-traditional while "fixed" refers to one
23 of its fonts.  You probably want to check the differences between
24 /etc/X11/fonts/misc/xfonts-base.alias and xfonts-base.alias.not-trad,
25 reconcile any changes, and then run "update-fonts-alias misc".
26 After that you can retry the removal.
27
28 END
29                 printf 'Continue anyway ? [n/y] '
30                 read x </dev/tty
31                 case "$x" in
32                 y*|Y*)  ;;
33                 *)      exit 1 ;;
34                 esac
35         fi
36
37         for d in /usr/share/fonts/X11 /usr/local/share/fonts/X11; do
38                 if ! test -e "$d"; then continue; fi
39
40                 find "$d" \
41                            -type f \
42                         \( -name xfonts-traditional.log -o \
43                            -name xfonts-traditional.done -o \
44                            -name xfonts-traditional.done.new -o  \
45                            -name trad--\*.pcf.gz.new \) \
46                         -print0 | xargs -0r rm --
47
48                 find "$d" \
49                            -type f \
50                            -name trad--\*.pcf.gz \
51                         -print0 | xargs -0r rm --
52         done
53
54         ;;
55
56 esac