wip po-debconf
[xfonts-traditional] / debian / xfonts-traditional.prerm
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4. /usr/share/debconf/confmodule
5aliasfile=/etc/X11/fonts/misc/xfonts-base.alias
6
7case "$1" in
8
9remove)
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
17Removing xfonts-traditional would break your X server by removing "fixed".
18
19You should not remove xfonts-traditional while "fixed" refers to one
20of its fonts. You probably want to check the differences between
21/etc/X11/fonts/misc/xfonts-base.alias and xfonts-base.alias.not-trad,
22reconcile any changes, and then run "update-fonts-alias misc".
23After that you can retry the removal.
24
25END
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
53esac