packaging fixes
[xfonts-traditional] / debian / xfonts-traditional.prerm
CommitLineData
12fa1ef8
IJ
1#!/bin/sh
2set -e
3
4. /usr/share/debconf/confmodule
b9008d6d 5aliasfile=/etc/X11/fonts/misc/xfonts-base.alias
12fa1ef8
IJ
6
7case "$1" in
8
9remove)
10
fb8fab66 11 echo 'Checking that "fixed" is not from xfonts-traditional...'
12fa1ef8 12
b9008d6d
IJ
13 if grep '^fixed[ ][ ]*-trad-' $aliasfile \
14 /usr/share/fonts/X11/misc/fonts.alias; then
fb8fab66 15 cat >&2 <<'END'
b9008d6d 16
489ffe21 17Removing xfonts-traditional would break your X server by removing "fixed".
4ff07717 18
12fa1ef8
IJ
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,
b9008d6d
IJ
22reconcile any changes, and then run "update-fonts-alias misc".
23After that you can retry the removal.
4ff07717 24
12fa1ef8 25END
4ff07717 26 printf 'Continue anyway ? [n/y] '
b9008d6d 27 read x </dev/tty
4ff07717
IJ
28 case "$x" in
29 y*|Y*) ;;
30 *) exit 1 ;;
31 esac
12fa1ef8
IJ
32 fi
33
b9008d6d
IJ
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
12fa1ef8 50
489ffe21
IJ
51 ;;
52
12fa1ef8 53esac