chiark / gitweb /
Merge branch 'i18n'
[xfonts-traditional.git] / debian / xfonts-traditional.prerm
index 71f3f5d2bee3b9b061be02e7ea0af4247f2e862f..7578f5250491227af21748ef7441bd33f90ce31a 100755 (executable)
@@ -2,7 +2,10 @@
 set -e
 
 . /usr/share/debconf/confmodule
-aliasfile=/etc/X11/fonts/misc/xfonts-base.alias
+
+#DEBHELPER#
+
+/usr/share/xfonts-traditional/checkfiles prerm "$@"
 
 case "$1" in
 
@@ -10,25 +13,20 @@ remove)
 
        echo 'Checking that "fixed" is not from xfonts-traditional...'
 
-       if grep '^fixed[         ][      ]*-trad-' $aliasfile \
-           /usr/share/fonts/X11/misc/fonts.alias; then
-               cat >&2 <<'END'
-
-Removing xfonts-traditional would break your X server by removing "fixed".
-
-You should not remove xfonts-traditional while "fixed" refers to one
-of its fonts.  You probably want to check the differences between
-/etc/X11/fonts/misc/xfonts-base.alias and xfonts-base.alias.not-trad,
-reconcile any changes, and then run "update-fonts-alias misc".
-After that you can retry the removal.
-
-END
-               printf 'Continue anyway ? [n/y] '
-               read x </dev/tty
-               case "$x" in
-               y*|Y*)  ;;
-               *)      exit 1 ;;
-               esac
+       if grep '^fixed[         ][      ]*-trad-' \
+                       /etc/X11/fonts/misc/xfonts-base.alias \
+                       /usr/share/fonts/X11/misc/fonts.alias; then
+
+               RET=''
+               db_input critical xfonts-traditional/confirm-break-remove ||:
+               db_go ||:
+               db_get xfonts-traditional/confirm-break-remove ||:
+               if [ x$RET != xtrue ]; then
+                       db_fset xfonts-traditional/confirm-break-remove \
+                               seen false ||:
+                       echo 'Aborting to avoid breaking "fixed".' >&2
+                       exit 1
+               fi
        fi
 
        for d in /usr/share/fonts/X11 /usr/local/share/fonts/X11; do