summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-02-11 09:02:06 -0800
committerKeith Packard <keithp@keithp.com>2014-02-12 08:05:27 -0800
commit76521bf09bfb400a9cac752387e69323f24ca223 (patch)
tree15115351cc4ff907673db985047c525c6396899e
parent6d90554db93b7a683b2e0e6c6b148585ab4a10ca (diff)
Remove links made in /etc/fonts/conf.d and debconf entries. Closes #730361.
When purging the fontconfig-config package, make sure the links created in /etc/fonts/conf.d get cleaned up, as well as any debconf database entries. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--debian/fontconfig-config.postrm25
1 files changed, 25 insertions, 0 deletions
diff --git a/debian/fontconfig-config.postrm b/debian/fontconfig-config.postrm
index 6f9d719..a39ae80 100644
--- a/debian/fontconfig-config.postrm
+++ b/debian/fontconfig-config.postrm
@@ -4,14 +4,39 @@ set -e
CONF=/etc/fonts/local.conf
+# Duplicate list of all possible links in /etc/fonts/conf.d created
+# in postinst
+unhinted="10-unhinted.conf"
+autohint="10-autohint.conf"
+subpixel="10-sub-pixel-rgb.conf"
+no_subpixel="10-no-sub-pixel.conf"
+yes_bitmaps="70-yes-bitmaps.conf"
+no_bitmaps="70-no-bitmaps.conf"
+
+CONFFILES="$unhinted $autohint $subpixel $no_subpixel $yes_bitmaps $no_bitmaps"
+CONFDIR=/etc/fonts/conf.d
+
case "$1" in
purge)
if [ -x /usr/bin/ucf ]; then
ucf --purge $CONF
fi
rm -f $CONF
+
+ # Remove any files linked in postinst
+ for c in $CONFFILES; do
+ rm -f $CONFDIR/$c
+ done
rmdir -p --ignore-fail-on-non-empty /etc/fonts/conf.d
+
+ # Remove an empty local fonts directory
rmdir /usr/local/share/fonts 2>/dev/null || true
+
+ # Purge debconf database
+ if [ -e /usr/share/debconf/confmodule ]; then
+ . /usr/share/debconf/confmodule
+ db_purge
+ fi
;;
esac