From 85ad35770e541b848bf2954424879318da797b84 Mon Sep 17 00:00:00 2001 From: joey Date: Sun, 24 Oct 1999 23:19:28 +0000 Subject: r294: * Fixed problem with dh_installemacsen options not working, patch from Rafael Laboissiere , Closes: #47738 * Added new dh_installxfonts script by Changwoo Ryu . Closes: #46684 I made some changes, though: - I rewrote lots of this script to be more my style of perl. - I removed all the verbisity from the postinst script fragment, since that is a clear violation of policy. - I made the postinst fail if the mkfontdir, etc commands fail, because this really makes more sense. Consider idempotency. - I moved the test to see if the font dir is really a directory into the dh_ script and out of the snippet. If the maintainer plays tricks on us, mkfontdir will blow up satisfactorally anyway. - So, the snippet is 9 lines long now, down from 20-some. - I realize this isn't following the reccommendations made in Brandon's font policy. I'll fight it out with him. :-) - In postrm fragment, used rmdir -p to remove as many parent directories as I can. - s:/usr/lib/X11/:/usr/X11R6/lib/X11/:g --- autoscripts/postinst-xfonts | 8 ++++++++ autoscripts/postrm-xfonts | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 autoscripts/postinst-xfonts create mode 100644 autoscripts/postrm-xfonts (limited to 'autoscripts') diff --git a/autoscripts/postinst-xfonts b/autoscripts/postinst-xfonts new file mode 100644 index 00000000..e3e6a1c6 --- /dev/null +++ b/autoscripts/postinst-xfonts @@ -0,0 +1,8 @@ +fontdirs="#FONTDIRS#" +updatecmds="#UPDATECMDS#" + +for dir in $fontdirs; do + for currentcmd in $updatecmds; do + $currentcmd /usr/X11R6/lib/X11/$dir + done +done diff --git a/autoscripts/postrm-xfonts b/autoscripts/postrm-xfonts new file mode 100644 index 00000000..53e2b6db --- /dev/null +++ b/autoscripts/postrm-xfonts @@ -0,0 +1,18 @@ +fontdirs="#FONTDIRS#" +updatecmds="#UPDATECMDS#" + +for currentdir in $fontdirs; do + longdir=/usr/X11R6/lib/X11/fonts/$currentdir + if [ -d $longdir ]; then + for file in fonts.dir fonts.alias; do + rm -f $file + done + if [ $(find $currentdir| wc -l) -eq 1 ]; then + rmdir -p $longdir + else + for currentcmd in $updatecmds; do + $currentcmd $longdir + done + fi + fi +done -- cgit v1.2.3