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