diff options
author | Lauri Leukkunen <lle@rahina.org> | 2008-09-27 00:21:04 +0300 |
---|---|---|
committer | Lauri Leukkunen <lle@rahina.org> | 2008-09-27 00:21:04 +0300 |
commit | 75329e4b764047d1ff4c59ca15cce8536e6c19fd (patch) | |
tree | fb7a3eba3043cefadb6340dab3dde84130dfa5c6 /utils/sb2-config | |
parent | 135c8169973d4b39707ce6b5fc4e281f669a5b63 (diff) |
Fix path detection for non-bash shells
Patch by Linus Walleij <triad@df.lth.se>
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
Diffstat (limited to 'utils/sb2-config')
-rwxr-xr-x | utils/sb2-config | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/utils/sb2-config b/utils/sb2-config index 1424553..4e408c6 100755 --- a/utils/sb2-config +++ b/utils/sb2-config @@ -2,6 +2,15 @@ # Copyright (C) 2006,2007 Lauri Leukkunen <lle@rahina.org> # Licensed under GPL version 2 +my_path=$_ +if [ $(basename $my_path) != $(basename $0) ]; then + my_path=$0 + if [ $(basename $my_path) = $my_path ]; then + my_path=$(which $my_path) + fi +fi + + function usage() { cat <<EOF @@ -40,7 +49,7 @@ DEFAULT_TARGET=$DEFAULT_TARGET " > $HOME/.scratchbox2/config } -SBOX_DIR=$(readlink -f $(dirname $(readlink -f $_))/..) +SBOX_DIR=$(readlink -f $(dirname $(readlink -f $my_path))/..) WRITE_CONFIG=0 while getopts d:hlv foo |