Commit | Line | Data |
---|---|---|
12fa1ef8 IJ |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
4 | . /usr/share/debconf/confmodule | |
6cc0cac2 IJ |
5 | |
6 | #DEBHELPER# | |
7 | ||
88ca873d | 8 | /usr/share/xfonts-traditional/checkfiles prerm "$@" |
12fa1ef8 IJ |
9 | |
10 | case "$1" in | |
11 | ||
12 | remove) | |
13 | ||
fb8fab66 | 14 | echo 'Checking that "fixed" is not from xfonts-traditional...' |
12fa1ef8 | 15 | |
88ca873d IJ |
16 | if grep '^fixed[ ][ ]*-trad-' \ |
17 | /etc/X11/fonts/misc/xfonts-base.alias \ | |
18 | /usr/share/fonts/X11/misc/fonts.alias; then | |
fb8fab66 | 19 | cat >&2 <<'END' |
b9008d6d | 20 | |
489ffe21 | 21 | Removing xfonts-traditional would break your X server by removing "fixed". |
4ff07717 | 22 | |
12fa1ef8 | 23 | You should not remove xfonts-traditional while "fixed" refers to one |
88ca873d IJ |
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. | |
4ff07717 | 28 | |
12fa1ef8 | 29 | END |
4ff07717 | 30 | printf 'Continue anyway ? [n/y] ' |
b9008d6d | 31 | read x </dev/tty |
4ff07717 IJ |
32 | case "$x" in |
33 | y*|Y*) ;; | |
34 | *) exit 1 ;; | |
35 | esac | |
12fa1ef8 IJ |
36 | fi |
37 | ||
b9008d6d IJ |
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 | |
12fa1ef8 | 54 | |
489ffe21 IJ |
55 | ;; |
56 | ||
12fa1ef8 | 57 | esac |