From 23d9f33beb0ab00741f2fc1771ff8fe0811e00d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Huss?= Date: Fri, 21 Jan 2011 11:55:18 +0100 Subject: [PATCH] pnd_run.sh: Fixed a bug where the appdata dir was created in the same directory as the PNDs --- testdata/scripts/pnd_run.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/testdata/scripts/pnd_run.sh b/testdata/scripts/pnd_run.sh index c5aced0..6cd5d9b 100644 --- a/testdata/scripts/pnd_run.sh +++ b/testdata/scripts/pnd_run.sh @@ -375,6 +375,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 +396,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 +407,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 -- 2.39.5