[csw-devel] [PATCH 1/2] Bootstrap on Solaris

Maciej Blizinski maciej at opencsw.org
Mon Feb 20 09:06:44 CET 2012


Solaris /bin/sh does not support "$( ... )" nor "if ! test ..."

Tested on Solaris 10.
---
 bootstrap     |   14 +++++++++++---
 modules/genmf |    6 ++++--
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/bootstrap b/bootstrap
index d315be2..1f478e2 100755
--- a/bootstrap
+++ b/bootstrap
@@ -22,7 +22,7 @@ export CYGWIN
 set -e
 set -x
 
-cd "$(dirname "$0")"
+cd "`dirname "$0"`"
 
 ##
 ## Check for various tools
@@ -66,8 +66,16 @@ fi
 
 # Check for autopoint (GNU gettext)
 export AUTOPOINT
-test "$AUTOPOINT" || AUTOPOINT=autopoint
-if ! "$AUTOPOINT" --dry-run --force >/dev/null 2>&1; then
+if test "$AUTOPOINT"; then
+  :
+else
+  AUTOPOINT=autopoint
+fi
+if "$AUTOPOINT" --dry-run --force >/dev/null 2>&1; then
+  # Solaris /bin/sh does not support "if ! test ...", we have to invert the
+  # expression and use the "else" statement.
+  :
+else
   AUTOPOINT=true
   echo > ABOUT-NLS
 fi
diff --git a/modules/genmf b/modules/genmf
index d7b2887..11cd702 100755
--- a/modules/genmf
+++ b/modules/genmf
@@ -7,14 +7,16 @@
 ##  Authors: Sam Hocevar <sam at zoy.org>
 ##           Rémi Denis-Courmont <rem # videolan # org>
 
-cd $(dirname "$0")/.. || exit 1
+cd `dirname "$0"`/.. || exit 1
 
 while test "$1"
 do
   printf "."
   dir="$1"
   modf="modules/${dir}/Modules.am"
-  if ! test -f "$modf"; then
+  if test -f "$modf"; then
+    :
+  else
     echo "$modf does not exist!" >&2
     exit 1
   fi
-- 
1.7.5.4



More information about the devel mailing list