makewrapper.sh patch


Subject: makewrapper.sh patch
From: Kevin Vajk (kvajk@ricochet.net)
Date: Thu Dec 28 2000 - 19:21:24 CST


I've made two changes to the makewrapper.sh script, which seem to make
life easier for me. I think this is the way to go, so if others agree
please consider checking this in.

The important change is that it now does *not* remove the font
directories it added to your font path. In the current scheme, two
concurrent abiword processes will still step on each other if the one
which was started first is exited first.
(I understand not wanting to leave behind litter in the font path after
we've exited, but I don't see any way around this, since there is no
reliable method of determining whether or not another abiword process
is still running on the same display.)

The other change is that any subdirectories of $ABISUITE_FONT_HOME which
contain a fonts.dir file are added to your font path as well. (For most
users, there won't be any.) I think this is cleaner than having a shell
script try to figure out your locale settings.

Thanks!

- Kevin Vajk
  <kvajk@ricochet.net>

Index: abi/src/pkg/common/unix/scripts/makewrapper.sh
===================================================================
RCS file: /cvsroot/abi/src/pkg/common/unix/scripts/makewrapper.sh,v
retrieving revision 1.9
diff -u -r1.9 makewrapper.sh
--- abi/src/pkg/common/unix/scripts/makewrapper.sh 2000/10/10 00:39:31 1.9
+++ abi/src/pkg/common/unix/scripts/makewrapper.sh 2000/12/29 01:12:50
@@ -43,8 +43,6 @@
 # AbiSuite program wrapper script, dynamically generated
 # from abi/src/pkg/common/unix/scripts/makewrapper.sh.
 
-currentFonts=\`xset q | grep Abi\`
-
 # Change this if you move the AbiSuite tree.
 ABISUITE_HOME=$INSTALL_BASE
 export ABISUITE_HOME
@@ -54,49 +52,30 @@
 
 # Change this if you move your fonts.
 ABISUITE_FONT_HOME=\$ABISUITE_HOME/fonts
-
-#locale-specific dirs could be added to it.
-ABISUITE_FONT_PATH=\$ABISUITE_FONT_HOME
-
-#now try to guess locale
-locale=\$LC_ALL #it's incorrect to set this variable, but someone
- #might set it incorrectly.
-if [ -z \$locale ]
-then
- locale=\$LANG
-fi
 
-if [ ! -z \$locale ]
-then
- #now guess encoding
- encoding=\`echo \$locale | sed -e 's/^.*\.\(.*\)\$/\1/'\`
- if [ ! -z \$encoding ]
- then
- addfontdir=\$ABISUITE_FONT_HOME/\$encoding
- if [ ! -z \$addfontdir ]
- then
- if [ -d \$addfontdir ]
- then
- #add directory with locale-specific fonts to font path
- ABISUITE_FONT_PATH=\$ABISUITE_FONT_PATH,\$addfontdir
- fi
- fi
- fi
-fi
-
-# Set run-time font path
+# Set run-time font path to include \$ABISUITE_FONT_HOME
+# as well as any font subdirectories
 if [ -d \$ABISUITE_FONT_HOME ]
 then
- xset fp+ \$ABISUITE_FONT_PATH 1>/dev/null 2>/dev/null
+ for fontdir in \$ABISUITE_FONT_HOME \${ABISUITE_FONT_HOME}/*
+ do
+ if [ -d "\$fontdir" -a -f "\${fontdir}/fonts.dir" ]
+ then
+ if ! xset q | grep -q -e "\${fontdir}," -e "\${fontdir}\$"
+ then
+ xset fp+ "\$fontdir" 1>/dev/null 2>/dev/null
+ fi
+ fi
+ done
 fi
 
 # Figure out which binary to run
 if [ -f \$ABISUITE_LIBEXEC/${PROGRAM_NAME}_d ]
 then
- \$ABISUITE_LIBEXEC/${PROGRAM_NAME}_d "\$@"
+ exec \$ABISUITE_LIBEXEC/${PROGRAM_NAME}_d "\$@"
 elif [ -f \$ABISUITE_LIBEXEC/${PROGRAM_NAME}_s ]
 then
- \$ABISUITE_LIBEXEC/${PROGRAM_NAME}_s "\$@"
+ exec \$ABISUITE_LIBEXEC/${PROGRAM_NAME}_s "\$@"
 else
     echo ""
     echo "Error: can't find ${PROGRAM_NAME} executables:"
@@ -105,15 +84,6 @@
     echo " \$ABISUITE_LIBEXEC/${PROGRAM_NAME}_s"
     echo ""
     exit
-fi
-#Check to make sure we don't stomp on anything
-if [ -z \$currentFonts ]
-then
- # Set post run-time font path
- if [ -d \$ABISUITE_FONT_HOME ]
- then
- xset fp- \$ABISUITE_FONT_PATH 1>/dev/null 2>/dev/null
- fi
 fi
 EOF
 



This archive was generated by hypermail 2b25 : Thu Dec 28 2000 - 19:29:01 CST