ENH: fix x11 launch script for leopord x11 is auto-started for us on that os.

This commit is contained in:
Bill Hoffman 2008-04-11 10:41:28 -04:00
parent 94f40300e8
commit 8350a17101
1 changed files with 21 additions and 0 deletions

View File

@ -5,6 +5,26 @@
CWD="`dirname \"$0\"`"
TMP=/tmp/$UID/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
ps -wx -ocommand | grep -e '[X]11.app' > /dev/null
if [ "$?" != "0" -a ! -f ~/.xinitrc ]; then
echo "rm -f ~/.xinitrc" > ~/.xinitrc
@ -42,4 +62,5 @@ echo "$@" > /tmp/arguments.log
if echo $1 | grep -- "^-psn_"; then
shift
fi
fi
exec "$CWD/bin/@CPACK_EXECUTABLE_NAME@" "$@" > /tmp/slicer.output 2>&1