rpms/xorg-x11/devel xfs.init,1.11,1.12

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Apr 5 03:53:29 UTC 2005


Update of /cvs/dist/rpms/xorg-x11/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv23670

Modified Files:
	xfs.init 
Log Message:
Fix bug #133451, and various other improvements


Index: xfs.init
===================================================================
RCS file: /cvs/dist/rpms/xorg-x11/devel/xfs.init,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- xfs.init	4 Apr 2005 21:16:43 -0000	1.11
+++ xfs.init	5 Apr 2005 03:53:27 -0000	1.12
@@ -20,6 +20,7 @@
 
 prog=xfs
 
+FC_CACHE=/usr/bin/fc-cache
 # Make sure that xfs has "/" as the CWD
 cd /
 
@@ -29,18 +30,14 @@
    # chkfontpath that we do not want, including headers, FPE numbers and
    # whitespace and other junk.  Also filters out FPE's with trailing
    # modifiers such as ":unscaled" et al.
-   for d in $(/usr/sbin/chkfontpath --list | sed -e '/^Current/d;s#^[0-9]*: ##g;s#^/.*:[a-z]*$##g;/^[[:space:]]*$/d' | sort | uniq) ;do
-      if [ -d "$d" ]; then
-         cd "$d"
-         # Check if we need to rerun mkfontdir
-         REGEN_FONTS_DIR=no
-         if ! [ -e fonts.dir ]; then
-            REGEN_FONTS_DIR=yes
-         elif [ -n "$(find . -type f -cnewer fonts.dir -not -name 'fonts.cache*')" ];then
-            REGEN_FONTS_DIR=yes
-         fi
-         if [ "$REGEN_FONTS_DIR" = "yes" ]; then
-            rm -f fonts.dir 
+   for dir in $(/usr/sbin/chkfontpath --list | sed -e '/^Current/d;s#^[0-9]*: ##g;s#^/.*:[a-z]*$##g;/^[[:space:]]*$/d' | sort | uniq) ;do
+      if [ -d "$dir" ]; then
+         cd "$dir"
+         # If fonts.dir does not exist, or if there are files in the
+         # directory with a newer change time, regenerate fonts.dir, etc.
+         # Using "-cnewer" here fixes bug #53737
+         if [ ! -e fonts.dir -o -n "$(find . -type f -cnewer fonts.dir -not -name 'fonts.cache*')" ]; then
+            rm -f fonts.dir
             if ls | grep -iqs '\.ot[cf]$' ; then
                # Opentype fonts found, generate fonts.scale and fonts.dir
                mkfontscale . && mkfontdir . &>/dev/null
@@ -55,19 +52,10 @@
          fi
       fi
    done
-   # Recreating fonts.dir files above may result in stale fonts.cache-1
-   # files since the directory mtimes change, so we run fc-cache to
-   # update any necessary fonts.cache files.
-   FC_CACHE=/usr/bin/fc-cache
-   if [ "$REGEN_FONTS_DIR" = "yes" -a -x "$FC_CACHE" ] ; then
-      # fc-cache 1.0.2 as included in Red Hat Linux 8.0 will SEGV when executed
-      # by this initscript, so we don't run fc-cache for version 1.0.2 since
-      # even if fc-cache were fixed, we can't guarantee the user would have the
-      # fixed version installed.  Yes, this is an ugly, but necessary hack for
-      # the time being.
-      #[ $FC_CACHE --version 2>&1 | grep -q '1\.0\.2' ] ||
-      HOME=/ "$FC_CACHE"
-   fi
+   # Now we run fc-cache, assuming fonts may have been added, without
+   # explicitly checking, as it is rather fast anyway.  Some older versions
+   # of fc-cache will SEGV, which is prevented by invoking it with HOME=/
+   [ -x "$FC_CACHE" ] HOME=/ "$FC_CACHE"
    popd &> /dev/null
 }
 




More information about the fedora-cvs-commits mailing list