# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# Author: Martin Schlemmer <azarah@gentoo.org>
-# $Header: /var/cvsroot/gentoo-x86/x11-base/xfree/files/4.2.1/xfs.start,v 1.2 2002/10/20 20:40:12 azarah Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-base/xfree/files/4.2.1/xfs.start,v 1.3 2002/10/20 21:06:36 azarah Exp $
#NB: Config is in /etc/conf.d/xfs
if [ ! -f $1/fonts.md5 ]
then
- # No md5 file exist, so create it and return 0 to add this font
- # dir as a candidate for updating...
- > $1/fonts.md5
- echo "${fontlist}" | xargs -i md5sum {} >> $1/fonts.md5
+ if [ -n "${fontlist}" ]
+ then
+ # No md5 file exist, so create it and return 0 to add this font
+ # dir as a candidate for updating...
+ > $1/fonts.md5
+ echo "${fontlist}" | xargs -i md5sum {} >> $1/fonts.md5
- return 0
+ return 0
+ fi
else
local retval=1
+
+ # All the fonts was removed, so cleanup
+ if [ -z "${fontlist}" ]
+ then
+ for x in $1/fonts.* $1/encodings.dir
+ do
+ if [ -f ${x} ]
+ then
+ rm -f ${x}
+ fi
+ done
+
+ return 1
+ fi
# If any md5 checksum fails, this dir should be updated.
if [ -n "$(md5sum -c $1/fonts.md5 2> /dev/null | egrep "FAILED")" ]
# While we at it, update fontconfig's cache as well
if [ -x /usr/bin/fc-cache ]
then
+ ebegin "Updating FC cache"
/usr/bin/fc-cache
+ eend 0
fi
if [ ! -x /usr/X11R6/bin/mkfontdir -o ! /usr/X11R6/bin/ttmkfdir2 ]