mark the restored scripts as executable
[pandora-libraries.git] / testdata / scripts / pnd_run.sh
old mode 100644 (file)
new mode 100755 (executable)
index c5aced0..0abee34
@@ -74,7 +74,7 @@ runApp() {
                export XDG_DATA_DIRS="/mnt/utmp/$PND_NAME/share:$XDG_DATA_DIRS:/usr/share"
        fi
        export XDG_CONFIG_HOME="/mnt/utmp/$PND_NAME"
-       "./$EXENAME" $ARGUMENTS 
+       "./$EXENAME" $ARGUMENTS
                                                # execute app with ld_lib_path set to the union mount, a bit evil but i think its a good solution
 
        #the app could have exited now, OR it went into bg, we still need to wait in that case till it really quits!
@@ -223,6 +223,8 @@ cleanups() {
        #delete folders created by aufs if empty
        rmdir -rf "${APPDATADIR}/.wh..wh.plnk" 2>/dev/null
        rmdir -rf "${APPDATADIR}/.wh..wh..tmp" 2>/dev/null
+       rmdir "${APPDATADIR}/.wh..wh.orph" 2>/dev/null
+       rm "${APPDATADIR}/.aufs.xino" 2>/dev/null
 
        #delete appdata folder and ancestors if _empty_
        rmdir -p "${APPDATADIR}" 2>/dev/null
@@ -375,6 +377,13 @@ done
 PNDARGS="$@"
 parseArgs "$@"
 
+#PND_NAME really should be something sensible and somewhat unique
+#if -b is set use that as pnd_name, else generate it from PND
+#get basename (strip extension if file) for union mountpoints etc, maybe  this should be changed to something specified inside the xml
+#this should probably be changed to .... something more sensible
+#currently only everything up to the first '.' inside the filenames is used.
+PND_NAME=${PND_NAME:-"$(basename $PND | cut -d'.' -f1)"}
+
 if [ ! -e "$PND" ]; then #check if theres a pnd suplied, need to clean that up a bit more
        echo "ERROR: selected PND($PND) file does not exist!"
        showHelp
@@ -389,7 +398,9 @@ fi
 
 PND_FSTYPE=$(file -b "$PND" | awk '{ print $1 }')      # is -p a zip/iso or folder?
 MOUNTPOINT=$(df "$PND" | tail -1|awk '{print $6}')     # find out on which mountpoint the pnd is
-if [ ! -d "$MOUNTPOINT" ] || [ $MOUNTPOINT = "/" ]; then 
+if [ $(df "$PND"|wc -l) -eq 1 ];then                   # this is actually a bug in busybox
+       MOUNTPOINT="/";
+elif [ ! -d "$MOUNTPOINT" ]; then 
        MOUNTPOINT="";
 fi
 
@@ -398,13 +409,6 @@ APPDATADIR=${APPDATADIR:-${MOUNTPOINT}/pandora/appdata/${PND_NAME}}
 
 LOGFILE="/tmp/pndrun_${PND_NAME}.out"
 
-#PND_NAME really should be something sensible and somewhat unique
-#if -b is set use that as pnd_name, else generate it from PND
-#get basename (strip extension if file) for union mountpoints etc, maybe  this should be changed to something specified inside the xml
-#this should probably be changed to .... something more sensible
-#currently only everything up to the first '.' inside the filenames is used.
-PND_NAME=${PND_NAME:-"$(basename $PND | cut -d'.' -f1)"}
-
 if [[ $ACTION != "run" ]];then #not logging mount and umount as these are from command-line
        main
 elif [ $nox ]; then