initialize uninitialized variable
[ardour.git] / tools / linux_packaging / ardour.sh.in
index aa84f083234969e364900a225ef4f52aa2959ad9..a6bd679b94266656dd07a16fa4068395b8a71931 100644 (file)
@@ -2,19 +2,18 @@
 
 # This is Linux-specific startup script for a bundled version of Ardour
 
-ARGS=""
+checkdebug(){
+    for arg in "$@"
+        do
+            case "$arg" in
+                --gdb )
+                    DEBUG="T"
+            esac
+        done
+}
 
-while [ $# -gt 0 ] ; do
-       case $1 in
+checkdebug "$@"
 
-       --debug)
-               DEBUG="T";
-               shift ;;
-       *)
-               ARGS=$ARGS$1" ";
-               shift; ;;
-       esac
-done
 
 # LD_LIBRARY_PATH needs to be set here so that epa can swap between the original and the bundled version
 # (the original one will be stored in PREBUNDLE_ENV)
@@ -25,11 +24,6 @@ BIN_DIR=$(dirname $(readlink -f $0))
 INSTALL_DIR=$(dirname $BIN_DIR)
 LIB_DIR=$INSTALL_DIR/lib
 ETC_DIR=$INSTALL_DIR/etc
-USER_ARDOUR_DIR=$HOME/.config/ardour3
-
-if [ ! -d $USER_ARDOUR_DIR ] ; then
-    mkdir -p $USER_ARDOUR_DIR || exit 1
-fi
 
 # this triggers code in main() that will reset runtime environment variables
 # to point to directories inside the ardour package
@@ -37,7 +31,7 @@ fi
 export ARDOUR_BUNDLED=true
 
 # NSM needs a path to this script
-export ARDOUR_SELF="$0"
+export ARDOUR_SELF=`basename "$0"`
 
 
 # this is edited by the build script to include relevant environment variables
@@ -51,10 +45,7 @@ export LD_LIBRARY_PATH=$INSTALL_DIR/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
 
 if [ "T" = "$DEBUG" ]; then
        export ARDOUR_INSIDE_GDB=1
-       exec gdb $INSTALL_DIR/bin/ardour-%VER%
+       exec gdb $INSTALL_DIR/bin/%EXENAME%-%VER%
 else
-       exec $INSTALL_DIR/bin/ardour-%VER% $ARGS
+       exec %WINE% $INSTALL_DIR/bin/%EXENAME%-%VER% "$@"
 fi
-
-
-