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