Browse Source

CPack: Fix bash-isms in launch script

Patch from Raphael Geissert and Modestas Vainius.  See issue #9659.
Brad King 16 years ago
parent
commit
b133467567
1 changed files with 4 additions and 4 deletions
  1. 4 4
      Modules/CPack.RuntimeScript.in

+ 4 - 4
Modules/CPack.RuntimeScript.in

@@ -3,10 +3,10 @@
 # Modified from: Aaron Voisine <[email protected]>
 
 CWD="`dirname \"$0\"`"
-TMP=/tmp/$UID/TemporaryItems
+TMP=/tmp/$(id -ru)/TemporaryItems
 
 version=`sw_vers -productVersion`
-if [ "$?" == "0" ]; then
+if [ "$?" = "0" ]; then
   major=${version%%\.*}
   rest=${version#*\.}
   minor=${rest%%\.*}
@@ -24,7 +24,7 @@ echo "Build = $build"
 
 
 # if 10.5 or greater, then all the open-x11 stuff need not occur
-if ((( $major < 10 )) || ((( $major == 10)) && (( $minor < 5 )))); then
+if [ "$major" -lt 10 ] || ([ "$major" -eq 10 ] && [ "$minor" -lt 5 ]); then
 version=`sw_vers -productVersion`
 if [ "$?" = "0" ]; then
   major=${version%%\.*}
@@ -44,7 +44,7 @@ echo "Build = $build"
 
 
 # if 10.5 or greater, then all the open-x11 stuff need not occur
-if ((( $major < 10 )) || ((( $major == 10)) && (( $minor < 5 )))); then
+if [ "$major" -lt 10 ] || ([ "$major" -eq 10 ] && [ "$minor" -lt 5 ]); then
 ps -wx -ocommand | grep -e '[X]11.app' > /dev/null
 if [ "$?" != "0" -a ! -f ~/.xinitrc ]; then
     echo "rm -f ~/.xinitrc" > ~/.xinitrc