Fix 'if [' portability issue

Francois Gouget fgouget at free.fr
Mon Dec 13 06:54:20 CST 2004


'if [ "$a" == "foo" ]' is not a portable construct. If running such a 
script with /bin/sh on Solaris, '[' is just a symbolic link to 'test' 
which does not support '=='. '=' must be used instead.

Changelog:

  * tools/findfunc
    tools/font_convert.sh

    Use '=' instead of '==' in /bin/sh scripts to avoid portability 
problems on (for instance) Solaris.


-- 
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
  "Only wimps use tape backup: _real_ men just upload their important stuff on
        ftp, and let the rest of the world mirror it ;)" -- Linus Torvalds
-------------- next part --------------
Index: tools/findfunc
===================================================================
RCS file: /var/cvs/wine/tools/findfunc,v
retrieving revision 1.2
diff -u -r1.2 findfunc
--- tools/findfunc	2 Jun 2002 21:16:58 -0000	1.2
+++ tools/findfunc	6 Dec 2004 22:48:10 -0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 name="$1"
-if [ "$name" == "" ] ; then
+if [ "$name" = "" ] ; then
     echo -n 'Function: '
     read name;
 fi
Index: tools/font_convert.sh
===================================================================
RCS file: /var/cvs/wine/tools/font_convert.sh,v
retrieving revision 1.5
diff -u -r1.5 font_convert.sh
--- tools/font_convert.sh	2 Dec 2004 19:52:50 -0000	1.5
+++ tools/font_convert.sh	6 Dec 2004 22:48:49 -0000
@@ -109,7 +109,7 @@
 done;
 
 for i in *.bdf; do
-    if [ "$i" == "*.bdf" ]; then
+    if [ "$i" = "*.bdf" ]; then
        echo "No fonts extracted"; rm -rf "$TMPDIR"; exit 0; 
     fi;
     bdftopcf "$i" | gzip -c > ${i%.???}.pcf.gz;


More information about the wine-patches mailing list