Skip to content

Commit

Permalink
fix osx handling of relative paths, full paths, etc, all more cleanly
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@2124 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Nov 13, 2012
1 parent 174c6db commit b88c15a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
11 changes: 3 additions & 8 deletions osx/Xpra
@@ -1,13 +1,8 @@
#!/bin/sh

name="`basename $0`"
if [[ "$0" == `pwd`* ]] || [[ "$0" == "//"* ]] || [[ "$0" == /Applications/* ]] || [[ "$0" == /Volumes/* ]] || [[ "$0" == /Users/* ]]; then
full_path="$0"
else
full_path="`pwd`/$0"
fi
full_path=$(cd "$(dirname "$0")"; pwd)

tmp=`dirname "$full_path"`
tmp=`dirname "$tmp"`
bundle=`dirname "$tmp"`
bundle_contents="$bundle"/Contents
bundle_res="$bundle_contents"/Resources
Expand Down Expand Up @@ -74,4 +69,4 @@ while (($#)); do
done
args="$args]"

exec $PYTHON -c "import sys;sys.argv[0]=\"$full_path\";from xpra.scripts.main import main;main('xpra', $args)"
exec $PYTHON -c "import sys;sys.argv[0]=\"$full_path\";from xpra.scripts.main import main;main('xpra', $args)"
14 changes: 7 additions & 7 deletions osx/Xpra_Launcher
@@ -1,14 +1,14 @@
#!/bin/sh

name="`basename $0`"
if [[ "$0" == `pwd`* ]] || [[ "$0" == "//"* ]] || [[ "$0" == /Applications/* ]] || [[ "$0" == /Volumes/* ]] || [[ "$0" == /Users/* ]]; then
full_path="$0"
else
full_path="`pwd`/$0"
fi
#ie: $0=/Users/MacAdmin/Desktop/Xpra.app/Contents/MacOS/Xpra_Launcher
#ie: $0=./Xpra.app/Contents/MacOS/Xpra_Launcher
full_path=$(cd "$(dirname "$0")"; pwd)
#ie: full_path=/Users/MacAdmin/Desktop/Xpra.app/Contents/MacOS/

tmp=`dirname "$full_path"`
tmp=`dirname "$tmp"`
#ie: tmp=/Users/MacAdmin/Desktop/Xpra.app/Contents
bundle=`dirname "$tmp"`
#ie: bundle=/Users/MacAdmin/Desktop/Xpra.app
bundle_contents="$bundle"/Contents
bundle_res="$bundle_contents"/Resources
bundle_lib="$bundle_res"/lib
Expand Down

0 comments on commit b88c15a

Please sign in to comment.