3 ######adjust path of genpxml.sh if you want to use that "feture"#####
5 TEMP=`getopt -o p:d:x:i: -- "$@"`
7 if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
12 -p) echo "PNDNAME set to $2" ;PNDNAME=$2;shift 2;;
13 -d) echo "FOLDER set to $2" ;FOLDER=$2;shift 2 ;;
14 -x) echo "PXML set to $2" ;PXML=$2;shift 2 ;;
15 -i) echo "ICON set to $2" ;ICON=$2;shift 2 ;;
17 *) echo "Error while parsing arguments! $2" ; exit 1 ;;
21 rnd=$RANDOM; # random number for genpxml and index$rnd.xml
23 #generate pxml if guess or empty
24 if [ ! $PXML ] || [ $PXML = "guess" ] && [ $PNDNAME ] && [ $FOLDER ]; then
25 PXMLtxt=$(/home/user/libpnd/pandora-libraries/testdata/scripts/genpxml.sh $FOLDER $ICON)
27 echo "$PXMLtxt" > $FOLDER/PXML.xml
31 if [ ! $PNDNAME ] || [ ! $FOLDER ] || [ ! $PXML ]; then
32 echo " Usage: pnd_make.sh -p your.pnd -d folder/containing/your/app/ -x
33 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 #check if folder actually exists
37 if [ ! -f $PXML ]; then echo "$PXML doesnt exist"; exit 1; fi #check if pxml actually exists
40 mkisofs -o $PNDNAME.iso -R $FOLDER
42 cat $PNDNAME.iso $PXML > $PNDNAME
43 rm $PNDNAME.iso #cleanup
45 #append icon if specified
46 if [ $ICON ]; then # check if we want to add an icon
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 # append icon
52 rm $PNDNAME.tmp #cleanup
56 if [ $PXML = "guess" ];then rm $FOLDER/PXML.xml; fi #cleanup