small changes to /etc/init.d/xfs
authorMartin Schlemmer <azarah@gentoo.org>
Sun, 20 Oct 2002 21:06:36 +0000 (21:06 +0000)
committerMartin Schlemmer <azarah@gentoo.org>
Sun, 20 Oct 2002 21:06:36 +0000 (21:06 +0000)
x11-base/xfree/files/4.2.1/xfs.start

index 23e3ffcbe761dcfe83f89df4db5c6fcc0f262779..56e47c71f68655b7030996056df76f6ed3ff17c0 100644 (file)
@@ -2,7 +2,7 @@
 # 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
 
@@ -36,14 +36,31 @@ check_md5sum() {
        
        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")" ]
@@ -112,7 +129,9 @@ setup_font_dirs() {
        # 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 ]