3 ######adjust path of genpxml.sh if you want to use that "feture"#####
5 TEMP=`getopt -o p:d:x:i:c -- "$@"`
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 ;;
16 -c) echo "-c set, will create compressed squasfs image instead of iso $2" ;SQUASH=1;shift 1 ;;
18 *) echo "Error while parsing arguments! $2" ; exit 1 ;;
22 rnd=$RANDOM; # random number for genpxml and index$rnd.xml
24 #generate pxml if guess or empty
25 if [ ! $PXML ] || [ $PXML = "guess" ] && [ $PNDNAME ] && [ $FOLDER ]; then
26 PXMLtxt=$(/home/user/libpnd/pandora-libraries/testdata/scripts/genpxml.sh $FOLDER $ICON)
28 echo "$PXMLtxt" > $FOLDER/PXML.xml
32 if [ ! $PNDNAME ] || [ ! $FOLDER ] || [ ! $PXML ]; then
33 echo " Usage: pnd_make.sh -p your.pnd -d folder/containing/your/app/ -x
34 your.pxml (or \"guess\" to try to generate it from the folder) -i icon.png"
37 if [ ! -d $FOLDER ]; then echo "$FOLDER doesnt exist"; exit 1; fi #check if folder actually exists
38 if [ ! -f $PXML ]; then echo "$PXML doesnt exist"; exit 1; fi #check if pxml actually exists
41 if [ ! $SQUASH ]; then
42 mkisofs -o $PNDNAME.iso -R $FOLDER
44 mksquashfs $FOLDER $PNDNAME.iso
47 cat $PNDNAME.iso $PXML > $PNDNAME
48 rm $PNDNAME.iso #cleanup
50 #append icon if specified
51 if [ $ICON ]; then # check if we want to add an icon
52 if [ ! -f $ICON ]; then #does the icon actually exist?
53 echo "$ICON doesnt exist"
55 mv $PNDNAME $PNDNAME.tmp
56 cat $PNDNAME.tmp $ICON > $PNDNAME # append icon
57 rm $PNDNAME.tmp #cleanup
61 if [ $PXML = "guess" ];then rm $FOLDER/PXML.xml; fi #cleanup