SF.net SVN: morphix: [2573] trunk/morphixlivekiosk/scripts/kabt.sh

[email protected] Sun, 21 Oct 2007 16:03:24 -0700
Newsgroups gmane.linux.morphix.cvs
Message-ID <[email protected]>
Revision: 2573
          http://morphix.svn.sourceforge.net/morphix/?rev=2573&view=rev
Author:   bmsleight
Date:     2007-10-21 16:03:23 -0700 (Sun, 21 Oct 2007)

Log Message:
-----------
Work in progress

Modified Paths:
--------------
    trunk/morphixlivekiosk/scripts/kabt.sh

Modified: trunk/morphixlivekiosk/scripts/kabt.sh
===================================================================
--- trunk/morphixlivekiosk/scripts/kabt.sh	2007-10-21 13:44:18 UTC (rev 2572)
+++ trunk/morphixlivekiosk/scripts/kabt.sh	2007-10-21 23:03:23 UTC (rev 2573)
@@ -97,7 +97,7 @@
 DHCP="$RETURN_VALUE"
 xml_get_tmp "//kiosk" "extralist" "MiniModule" $TEMPLATE
 EXTRAMINIS=$(cat $TMP_FILE)
-OUTPUT="$LOCALDIR/$DATE_$BRAND"
+OUTPUT="$LOCALDIR/${DATE}_$BRAND"
 }
 
 build_kiosk_setting_mini ()
@@ -179,19 +179,70 @@
 fi
 }
 
+write_buildlist ()
+{
+if [ "$NOTESTING" = "true" ]; then
+	ECHOBUILDLIST="$OUTPUT.iso"
+else
+	ECHOBUILDLIST="$OUTPUT.iso $OUTPUT.ogg"
+fi
+if [ -n "$BUILDLIST" ]; then
+	echo "$ECHOBUILDLIST" >$BUILDLIST
+fi
+echo "$ECHOBUILDLIST"
+}
 
+get_head_of_queue ()
+{
+echo "Get head of queue"
+wget --tries=3 --timeout=60 -nv --output-document=$TMP_DIR/queue.txt $QUEUEURL
+HEADTEMPLATE=$(head -n 1 $TMP_DIR/queue.txt)
+wget --tries=3 --timeout=60 -nv --output-document=$TMP_DIR/template.xml $HEADTEMPLATE
+}
+
+call_kabt ()
+{
+echo "Kabt calling kabt (recursive)"
+if [ "$NOTESTING" = "true" ]; then
+	CALLTESTING="-n"
+else
+	CALLTESTING=""
+fi
+$0 $CALLTESTING -b $TMP_DIR/build-list.txt -t $TMP_DIR/template.xml -l $LOCALDIR
+}
+
+call_webserver_with_links ()
+{
+echo "Call Webserver with links"
+CALLWL="${EXTERNALURL}"
+CALLWLISO=$(cut -d\  -f1 $TMP_DIR/build-list.txt)
+CALLWLOGG=$(cut -d\  -f2 $TMP_DIR/build-list.txt)
+CALLWLISOBN=$(basename $CALLWLISO)
+CALLWLOGGBN=$(basename $CALLWLOGG)
+CALLWL="${EXTERNALURL}&b=${CALLWLISOBN}&v=${CALLWLOGGBN}"
+echo wget --tries=3 --timeout=60 -nv --output-document=$TMP_DIR/call.txt $CALLWL
+}
+
+
 build_kiosk ()
 {
-echo 
 get_template_details 
 build_kiosk_setting_mini
 put_kiosk_parts_together
 rebrand
 save_iso
 autotest
+write_buildlist
 }
 
-while getopts Snt:l:q:e: opt
+queue_build_kiosk ()
+{
+get_head_of_queue
+call_kabt
+call_webserver_with_links
+}
+
+while getopts Snt:l:q:e:b: opt
 do
     case "$opt" in
       S)  SETUP="true";;
@@ -200,10 +251,11 @@
       q)  QUEUEURL="$OPTARG";;
       l)  LOCALDIR="$OPTARG";;
       e)  EXTERNALURL="$OPTARG";;
+      b)  BUILDLIST="$OPTARG";;
       
       \?)		# unknown flag
       	  echo >&2 " kabt -S /output/directory/"
-	  echo >&2 " kabt [-n] -t template.xml -l /var/www/upload/"
+	  echo >&2 " kabt [-n] [-b ./build-list.txt] -t template.xml -l /var/www/upload/"
 	  echo >&2 " kabt [-n] -q http://example.com/queue/ -l /var/www/upload/ -e www.foobar.com%2Fupload%2F"
 	  exit 1;;
     esac
@@ -213,13 +265,14 @@
 #Confirm parameters
 if [ -z "$SETUP$TEMPLATE$QUEUEURL" ]; then
 	echo " kabt -S"
-	echo " kabt [-n] -t template.xml -l /var/www/upload/"
+	echo " kabt [-n] [-b ./build-list.txt] -t template.xml -l /var/www/upload/"
 	echo " kabt [-n] -q http://example.com/queue/ -l /var/www/upload/ -e www.foobar.com%2Fupload%2F"
 	echo 
 	echo "  -S download all the parts and set-up kabt. "
 	echo "  -n Do not test the built kiosk LiveCD"
 	echo "  -t using the template build and test a Kiosk LiveCD"
 	echo "     -l  The local location of the built videos and iso"
+	echo "     -b  Write the built file names to this file"
 	echo "  -q queue.txt Build the first template in the queue.txt"
 	echo "     The http://example.com/queue/ contains a plain txt of urls pointing a list of templates.xml "
 	echo "     -l  The local location of the built videos and iso"
@@ -247,5 +300,7 @@
 if [ -n "$TEMPLATE" ]; then
 	build_kiosk
 fi
-
+if [ -n "$QUEUEURL" ]; then
+	queue_build_kiosk
+fi
 clean_tmp


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/