[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

X Strike Force XFree86 SVN commit: rev 718 - trunk/debian



Author: branden
Date: 2003-10-27 03:41:32 -0500 (Mon, 27 Oct 2003)
New Revision: 718

Modified:
   trunk/debian/changelog
   trunk/debian/shell-lib.sh
Log:
Further improvements and bugfixes to font_update.
+ define a local variable to store the X font directory prefix
  (/usr/X11R6/lib/X11/fonts), as this may change in the future
+ improve language of warnings issued when font update command not found
  or font directory does not exist
+ improve efficiency by using shell parameter expansion instead of
  basename utility
+ test for the existence of the full filespec of the font directory, not just
  its basename; duh

- debian/shell-lib.sh


Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2003-10-27 01:38:22 UTC (rev 717)
+++ trunk/debian/changelog	2003-10-27 08:41:32 UTC (rev 718)
@@ -98,11 +98,17 @@
       - use die() instead of message()
     + font_update():
       - explicitly scope local variables and make them lowercase
+      - define a local variable to store the X font directory prefix
+        (/usr/X11R6/lib/X11/fonts), as this may change in the future
       - call reject_unlikely_path_chars() on shell variables used
       - confirm that the font directory being operated exists before attempting
         operations on it
       - don't let failures of a font update command be fatal to the package; if
         a command fails, warn() about it instead
+      - improve language of warnings issued when font update command not found
+        or font directory does not exist
+      - improve efficiency by using shell parameter expansion instead of
+        basename utility
     + remove_conffile_prepare(),remove_conffile_commit(),
       remove_conffile_rollback(): use usage_error() instead of usage_errormsg()
     + remove_conffile_rollback(): correct self-reference in error message (cut
@@ -244,7 +250,7 @@
     (Closes: #207837)
     - debian/po/nl.po
 
- -- Branden Robinson <branden@debian.org>  Sun, 26 Oct 2003 19:02:22 -0500
+ -- Branden Robinson <branden@debian.org>  Mon, 27 Oct 2003 03:35:30 -0500
 
 xfree86 (4.2.1-12.1) unstable; urgency=low
 

Modified: trunk/debian/shell-lib.sh
===================================================================
--- trunk/debian/shell-lib.sh	2003-10-27 01:38:22 UTC (rev 717)
+++ trunk/debian/shell-lib.sh	2003-10-27 08:41:32 UTC (rev 718)
@@ -353,8 +353,10 @@
 font_update () {
   # run $UPDATECMDS in $FONTDIRS
 
-  local dir cmd shortcmd
+  local dir cmd shortcmd x_font_dir_prefix
 
+  x_font_dir_prefix="/usr/X11R6/lib/X11/fonts"
+
   if [ -z "$UPDATECMDS" ]; then
     usage_error "font_update() called but \$UPDATECMDS not set"
   fi
@@ -366,10 +368,10 @@
   reject_unlikely_path_chars "$FONTDIRS"
 
   for dir in $FONTDIRS; do
-    if [ -d "$dir" ]; then
+    if [ -d "$x_font_dir_prefix/$dir" ]; then
       for cmd in $UPDATECMDS; do
         if which "$cmd" > /dev/null 2>&1; then
-          shortcmd=$(basename $cmd)
+          shortcmd=${cmd##*/}
           observe "running $shortcmd in $dir font directory"
           if [ "$shortcmd" = "xftcache" ]; then
             if [ "$dir" = "Speedo" ]; then
@@ -379,16 +381,17 @@
             fi
             # KLUDGE: xftcache needs to be handed the full path; the command
             # goes away anyway in XFree86 4.3.0
-            dir="/usr/X11R6/lib/X11/fonts/$dir"
+            dir="$x_font_dir_prefix/$dir"
           fi
           $cmd $dir || warn "$cmd $dir failed; font directory data may not" \
                             "be up to date"
         else
-          warn "$cmd not found; not updating $dir font directory data"
+          warn "$cmd not found; not updating corresponding $dir font" \
+               "directory data"
         fi
       done
     else
-      warn "$dir is not a directory; not updating corresponding font data"
+      warn "$dir is not a directory; not updating font directory data"
     fi
   done
 }



Reply to: