Added x11-fonts trigger for mkfontdir/mkfontscale.

--HG--
extra : convert_revision : 95f8a9e2f43b8288dc31287d6fd077d705968627
This commit is contained in:
Juan RP 2009-03-23 16:42:01 +01:00
parent 47eba22f14
commit bf879f5f33
2 changed files with 62 additions and 0 deletions

View file

@ -77,6 +77,13 @@ _EOF
fi
echo >> $tmpf
#
# Handle X11 font updates via mkfontdir/mkfontscale.
#
if [ -n "${font_dirs}" ]; then
echo "font_dirs=\"${font_dirs}\"" >> $tmpf
fi
if [ -n "$triggers" ]; then
found=1
echo "case \"\$2\" in" >> $tmpf

55
triggers/x11-fonts Executable file
View file

@ -0,0 +1,55 @@
#!/bin/sh
#
# This trigger rebuilds the fonts.dir and fonts.scale files
# for packages that install X11 fonts.
#
# Arguments: $1 = action [run/targets]
# $2 = target [post-install/pre-remove]
# $3 = pkgname
#
trigger="x11-fonts"
case "$1" in
targets)
echo "post-install pre-remove"
;;
run)
if [ ! -x ${mkfontdir} -a ! -x ${mkfontscale} ]; then
exit 0
fi
[ -z "${font_dirs}" ] && exit 0
echo "Running $trigger trigger..."
case "$2" in
post-install)
for dir in ${font_dirs}; do
echo "Building ${dir}/fonts.dir..."
mkfontdir .${dir} || exit $?
echo "Building ${dir}/fonts.scale..."
mkfontscale .${dir} || exit $?
done
;;
pre-remove)
for dir in ${font_dirs}; do
if [ -f .${dir}/fonts.dir ]; then
rm -f .${dir}/fonts.dir
fi
if [ -f .${dir}/fonts.scale ]; then
rm -f .${dir}/fonts.scale
fi
if [ -f .${dir}/encodings.dir ]; then
rm -f .${dir}/encodings.dir
fi
done
;;
esac
;;
*)
exit 1
;;
esac
exit 0