]> git.openpandora.org Git - pandora-libraries.git/commitdiff
Updated support scripts
authoruser <user@pndtest.(none)>
Sat, 31 Oct 2009 20:49:05 +0000 (21:49 +0100)
committeruser <user@pndtest.(none)>
Sat, 31 Oct 2009 20:49:05 +0000 (21:49 +0100)
modified:   genpxml.sh
modified:   pnd_make.sh
modified:   pnd_run.sh

testdata/scripts/genpxml.sh
testdata/scripts/pnd_make.sh
testdata/scripts/pnd_run.sh

index dd0aa8e043cc9c456b5336060f9be62e8da14866..8a2af0356973537987db7b6ca205c920277e740f 100755 (executable)
@@ -12,8 +12,7 @@ loc=$(dirname "$0")
  
 echo '
 <?xml version="1.0" encoding="UTF-8"?>
-<PXML xmlns="http://openpandora.org/namespaces/PXML" 
-xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="'$BASENAME-$rnd'" xsi:noNamespaceSchemaLocation="PXML_schema.xsd">
+<PXML xmlns="http://openpandora.org/namespaces/PXML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="'$BASENAME-$rnd'" xsi:noNamespaceSchemaLocation="PXML_schema.xsd">
   <title lang="en_US">'$BASENAMEnoex'</title>
   <title lang="de_DE">'$BASENAMEnoex' - German (lol!)</title>
  
@@ -23,6 +22,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="'$BASENAME-$rnd'" xsi:
   <description lang="de_DE">de_DE Automatisch generiertes pxml aus'$(pwd)' exe='$BASENAME'</description>
  
   <previewpics>'
+#add all images in the folder as preview pics
 for image in $(file -i -0 * | grep -a image | cut -d" " -f1)
 do
 echo "<pic src="$image"/>"
@@ -46,4 +46,4 @@ echo '  </previewpics>
  
   <clockspeed frequency="600"/><!--Frequency in Hz-->
 </PXML>
-'
+'
\ No newline at end of file
index 2586ac68ec30ac9b24c95752617d0f38e88bc993..6643f3e4212ca9aaef96b38d97d0f0db6da006f4 100755 (executable)
@@ -1,7 +1,6 @@
 #!/bin/bash
  
 ######adjust path of genpxml.sh if you want to use that "feture"#####
-# \!/ black magic ahead
  
 TEMP=`getopt -o p:d:x:i: -- "$@"`
  
@@ -21,38 +20,37 @@ done
  
 rnd=$RANDOM; # random number for genpxml and index$rnd.xml
  
-if [ $PXML = "guess" ] && [  $PNDNAME ] && [ $FOLDER ];  then
-       PXMLtxt=$(~/pndtest/genxml.sh $FOLDER $ICON)
+#generate pxml if guess or empty
+if [ ! $PXML ] || [ $PXML = "guess" ] && [  $PNDNAME ] && [ $FOLDER ];  then
+       PXMLtxt=$(./genpxml.sh $FOLDER $ICON)
        PXML=tmp$rnd.pxml
        echo "$PXMLtxt" > tmp$rnd.pxml
 fi
  
+#check arguments
 if [ ! $PNDNAME ] || [ ! $FOLDER ] || [ ! $PXML ]; then
        echo " Usage: pnd_make.sh -p your.pnd -d folder/containing/your/app/ -x 
        your.pxml (or \"guess\" to try to generate it from the folder) -i icon.png"
        exit 1
 fi
+if [ ! -d $FOLDER ]; then echo "$FOLDER doesnt exist"; exit 1; fi #check if folder actually exists
+if [ ! -f $PXML ]; then echo "$PXML doesnt exist"; exit 1; fi #check if pxml actually exists
  
-if [ ! -d $FOLDER ]; then echo "$FOLDER doesnt exist"; exit 1; fi
-if [ ! -f $PXML ]; then echo "$PXML doesnt exist"; exit 1; fi
- 
- 
+#make iso from folder
 mkisofs -o $PNDNAME.iso -R $FOLDER
-#pxmlstart=$(stat -c%s "$PNDNAME.iso")
- 
+#append pxml to iso
 cat $PNDNAME.iso $PXML >  $PNDNAME
-rm $PNDNAME.iso
+rm $PNDNAME.iso #cleanup
  
-if [ $ICON ]; then # is -i used?
+#append icon if specified
+if [ $ICON ]; then # check if we want to add an icon
        if [ ! -f $ICON ]; then #does the icon actually exist?
                echo "$ICON doesnt exist"
        else # yes
        mv $PNDNAME $PNDNAME.tmp
-       cat $PNDNAME.tmp $ICON > $PNDNAME
+       cat $PNDNAME.tmp $ICON > $PNDNAME # append icon
+       rm $PNDNAME.tmp #cleanup
        fi
 fi
  
-if [ $PXML = "guess" ];then rm tmp$rnd.pxml; fi
- 
-#printf %08d $pxmlstart >> $PNDNAME #append end of iso/start of pxml offset
-
+if [ $PXML = "guess" ];then rm tmp$rnd.pxml; fi #cleanup
index c78d3a9a1d91600034432b565af47c86b7c92e10..715255664688c08d660972d800801f8126410ca5 100755 (executable)
@@ -1,7 +1,6 @@
 #!/bin/bash
- #needs some serious cleanup!
  
-#Usage: pnd_run.sh -p your.pnd -e executeable [-a "(arguments)"] [ -s "cd to folder inside pnd"] [-u (skip union)] [-b override BASENAME (name of mountpoint/appdata)] [-x close x before launching(script needs to be started with nohup for this to work]
+#Usage: pnd_run.sh -p your.pnd -e executeable [-a "(arguments)"] [ -s "cd to folder inside pnd"] [-u (skip union)] [-b override BASENAME (name of mountpoint/pandora/appdata)] [-x close x before launching(script needs to be started with nohup for this to work]
 # -n to skip union mount, should probably be removed before release
 # -s startdir
 # arguments can be inside -e, -a is optional
@@ -47,7 +46,7 @@ while true ; do
 done
  
 if [ ! $PND ]; then
-       echo "Usage: pnd_run.sh -p your.pnd -e executeable [-a \"(arguments)\"] [ -s \"cd to folder inside pnd\"] [-u (skip union)] [-b override BASENAME (name of mountpoint/appdata)] [-x close x before launching(script needs to be started with nohup for this to work]"
+       echo "Usage: pnd_run.sh -p your.pnd -e executeable [-a \"(arguments)\"] [ -s \"cd to folder inside pnd\"] [-u (skip union)] [-b override BASENAME (name of mountpoint/pandora/appdata)] [-x close x before launching(script needs to be started with nohup for this to work]"
        exit 1
 fi
 if [ $nox ]; then
@@ -117,7 +116,7 @@ fi
  
 #create mountpoints, check if they exist already first to avoid annoying error messages
 if [ ! -d /mnt/pnd/$BASENAME ]; then sudo mkdir -p /mnt/pnd/$BASENAME ; fi
-if [ ! -d $MOUNTPOINT/appdata/$BASENAME ]; then sudo mkdir -p $MOUNTPOINT/appdata/$BASENAME; fi
+if [ ! -d $MOUNTPOINT/pandora/appdata/$BASENAME ]; then sudo mkdir -p $MOUNTPOINT/pandora/appdata/$BASENAME; fi
 if [ ! -d /mnt/utmp/$BASENAME ]; then sudo mkdir -p /mnt/utmp/$BASENAME; fi 
  
 #mount
@@ -129,7 +128,7 @@ if [ ! $NOUNION ] && [ ! $umount ]; then
                echo "$mntline"
                $mntline #mount the pnd/folder
                echo "mounting union!"
-               sudo mount -t aufs -o exec,dirs\=$MOUNTPOINT/appdata/$BASENAME=rw+nolwh:/mnt/pnd/$BASENAME=rr none /mnt/utmp/$BASENAME # put union on top
+               sudo mount -t aufs -o exec,dirs\=$MOUNTPOINT/pandora/appdata/$BASENAME=rw+nolwh:/mnt/pnd/$BASENAME=rr none /mnt/utmp/$BASENAME # put union on top
  
        else
                echo "Union already mounted"
@@ -185,8 +184,9 @@ if [ $NOUNION ] ; then sudo umount /mnt/pnd/$BASENAME; fi #umount iso if -u WAS
 if [ $? -eq 0 ]; then # check if the umount was successfull, if it wasnt it would mean that theres still something running so we skip this stuff, this WILL lead to clutter if it happens, so we should make damn sure it never happens
        if [ ! $NOUNION ] ; then
                sudo umount /mnt/pnd/$BASENAME
-               sudo rmdir $MOUNTPOINT/appdata/$BASENAME/.wh..wh.plink 
-               sudo rmdir $MOUNTPOINT/appdata/$BASENAME/
+               sudo rmdir $MOUNTPOINT/pandora/appdata/$BASENAME/.wh..wh.plnk
+               sudo rmdir $MOUNTPOINT/pandora/appdata/$BASENAME/.wh..wh..tmp 
+               sudo rmdir $MOUNTPOINT/pandora/appdata/$BASENAME/
                sudo rmdir /mnt/utmp/$BASENAME;
        fi
        if [ $DFS = ISO ]; then
@@ -200,5 +200,3 @@ echo "starting x in 5s"
 sleep 5
 sudo /etc/init.d/gdm start
 fi
-
-