3 ######adjust path of genpxml.sh if you want to use that "feture"#####
4 # \!/ black magic ahead
6 TEMP=`getopt -o p:d:x:i: -- "$@"`
8 if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
13 -p) echo "PNDNAME set to $2" ;PNDNAME=$2;shift 2;;
14 -d) echo "FOLDER set to $2" ;FOLDER=$2;shift 2 ;;
15 -x) echo "PXML set to $2" ;PXML=$2;shift 2 ;;
16 -i) echo "ICON set to $2" ;ICON=$2;shift 2 ;;
18 *) echo "Error while parsing arguments! $2" ; exit 1 ;;
22 rnd=$RANDOM; # random number for genpxml and index$rnd.xml
24 if [ $PXML = "guess" ] && [ $PNDNAME ] && [ $FOLDER ]; then
25 PXMLtxt=$(~/pndtest/genxml.sh $FOLDER $ICON)
27 echo "$PXMLtxt" > tmp$rnd.pxml
30 if [ ! $PNDNAME ] || [ ! $FOLDER ] || [ ! $PXML ]; then
31 echo " Usage: pnd_make.sh -p your.pnd -d folder/containing/your/app/ -x
32 your.pxml (or \"guess\" to try to generate it from the folder) -i icon.png"
36 if [ ! -d $FOLDER ]; then echo "$FOLDER doesnt exist"; exit 1; fi
37 if [ ! -f $PXML ]; then echo "$PXML doesnt exist"; exit 1; fi
40 mkisofs -o $PNDNAME.iso -R $FOLDER
41 #pxmlstart=$(stat -c%s "$PNDNAME.iso")
43 cat $PNDNAME.iso $PXML > $PNDNAME
46 if [ $ICON ]; then # is -i used?
47 if [ ! -f $ICON ]; then #does the icon actually exist?
48 echo "$ICON doesnt exist"
50 mv $PNDNAME $PNDNAME.tmp
51 cat $PNDNAME.tmp $ICON > $PNDNAME
55 if [ $PXML = "guess" ];then rm tmp$rnd.pxml; fi
57 #printf %08d $pxmlstart >> $PNDNAME #append end of iso/start of pxml offset