From b13346756753cb8cd26f6436abcd4b303f057776 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 5 Oct 2009 13:14:30 -0400 Subject: [PATCH] CPack: Fix bash-isms in launch script Patch from Raphael Geissert and Modestas Vainius. See issue #9659. --- Modules/CPack.RuntimeScript.in | 44 +++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Modules/CPack.RuntimeScript.in b/Modules/CPack.RuntimeScript.in index eaecdd8fa..f27444fd9 100755 --- a/Modules/CPack.RuntimeScript.in +++ b/Modules/CPack.RuntimeScript.in @@ -3,28 +3,8 @@ # Modified from: Aaron Voisine CWD="`dirname \"$0\"`" -TMP=/tmp/$UID/TemporaryItems +TMP=/tmp/$(id -ru)/TemporaryItems -version=`sw_vers -productVersion` -if [ "$?" == "0" ]; then - major=${version%%\.*} - rest=${version#*\.} - minor=${rest%%\.*} - build=${rest#*\.} -else - major=10 - minor=4 - build=0 -fi - -echo $version -echo "Major = $major" -echo "Minor = $minor" -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 version=`sw_vers -productVersion` if [ "$?" = "0" ]; then major=${version%%\.*} @@ -44,7 +24,27 @@ 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%%\.*} + rest=${version#*\.} + minor=${rest%%\.*} + build=${rest#*\.} +else + major=10 + minor=4 + build=0 +fi + +echo $version +echo "Major = $major" +echo "Minor = $minor" +echo "Build = $build" + + +# if 10.5 or greater, then all the open-x11 stuff need not occur +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