[Debian-live-changes] r1226 - dists/trunk/live-webbuilder

Richard Nelson rjent-guest at alioth.debian.org
Fri May 4 13:38:13 UTC 2007


Author: rjent-guest
Date: 2007-05-04 13:38:12 +0000 (Fri, 04 May 2007)
New Revision: 1226

Added:
   dists/trunk/live-webbuilder/live-webbuilder.sh
Log:
This is just the draft work for live-webbuilder.

Added: dists/trunk/live-webbuilder/live-webbuilder.sh
===================================================================
--- dists/trunk/live-webbuilder/live-webbuilder.sh	2007-05-04 13:05:23 UTC (rev 1225)
+++ dists/trunk/live-webbuilder/live-webbuilder.sh	2007-05-04 13:38:12 UTC (rev 1226)
@@ -0,0 +1,173 @@
+#!/bin/bash
+
+##########################################
+# 20070503 Nelson
+# - Set version to 0.2.3
+# - Cleanup the expressions to work correct.
+# - Added some base values.
+# - Changed name to live-webbuilder to match svn granted by panthera.
+# 20070502 Nelson 
+# - Set version to 0.2
+# - Get initial layout of idea.
+
+##########################################
+# Set some global the parameters
+##########################################
+VERSION_NUMBER="0.2.3"
+WWW_WORK_PATH="/tmp/"
+WWW_MIRROR_BUILD="http://localhost/debian"
+
+##########################################
+# Send the HTTP headers
+##########################################
+echo "Content-type: text/html"
+echo ""
+
+##########################################
+# Start sending HTML
+##########################################
+cat << HTMLHEADER
+<html>
+	<head>
+		<title>WWW Debian Live Version ${VERSION_NUMBER}</title>
+
+		<link rel="icon" href="http://debian-live.alioth.debian.org/favicon.ico" type="image/ico">
+		<link rel="stylesheet" type="text/css" href="http://debian-live.alioth.debian.org/images/style.css" />
+		<meta http-equiv="content-type" content="text/html; charset=iso-8859-15">
+		<meta name="keywords" content="Debian, Live, Project">
+
+		<meta name="description" content="The Debian Live Project">
+	</head>
+<body>
+<div id="header">
+	<div id="debianlogo"><img src="http://debian-live.alioth.debian.org/images/debian.png" alt="Debian logo" width="56" height="70"></div>
+
+	<div id="headertitle"><a href="http://debian-live.alioth.debian.org/" title="http://debian-live.alioth.debian.org/">Debian Live</a></div>
+	<div id="headersubtitle">Live Debian systems!</div>
+</div>
+
+<div id="maincontent" style="margin: 0 0 0 0;">
+<h1>This is the live-webbuild interface version ${VERSION_NUMBER} for the <a href="http://debian-live.alioth.debian.org/">Debian Live</a> project.</h1>
+</div>
+HTMLHEADER
+	
+##########################################
+# Collet the parms
+##########################################
+#echo $QUERY_STRING
+
+if [ -z "$QUERY_STRING" ]; then  
+	##########################################
+	# Generate the form since it looks like
+	# no parameters were detected being passed.
+	##########################################
+	cat << HTMLBLOCK
+<BR><H2>Please submit your parameters (email is required) to generate you live cd. </H2>
+<BR><BR>
+<FORM method=get action=/cgi-bin/live-webbuilder.sh>
+<TABLE>
+<TR><TD>* Email Address: </TD><TD> <INPUT SIZE=40 NAME=www_reply_to_email></TD></TR>
+<TR><TD> --packages-lists: </TD><TD>
+<select name="www_packages_lists" size="1">
+<option value="gnome" SELECTED>gnome</option>
+<option value="gnome-core">gnome-core</option>
+<option value="gnome-full">gnome-full</option>
+<option value="gnome-junior">gnome-junior</option>
+<option value="gnustep">gnustep</option>
+<option value="kde">kde</option>
+<option value="kde-core">kde-core</option>
+<option value="kde-extra">kde-extra</option>
+<option value="kde-full">kde-full</option>
+<option value="kde-junior">kde-junior</option>
+<option value="mini">mini</option>
+<option value="minimal">minimal</option>
+<option value="rescue">rescue</option>
+<option value="standard">standard</option>
+<option value="standard-x11">standard-x11</option>
+<option value="xfce">xfce</option>
+<option value="xfce-junior">xfce-junior</option>
+</select></TD></TR>
+<TR><TD> --distribution: </TD><TD>
+<select name="www_distribution" size="1">
+<option value="etch" SELECTED>etch</option>
+<option value="lenny">lenny</option>
+<option value="sid">sid</option>
+</select></TD></TR>
+<TR><TD> --binary-image: </TD><TD>
+<select name="www_binary_image" size="1">
+<option value="hdd">hdd</option>
+<option value="iso" SELECTED>iso</option>
+<option value="hdd">usb</option>
+<option value="hdd">net</option>
+</select></TD></TR>
+<TR><TD> --filesystem: </TD><TD>
+<select name="www_filesystem" size="1">
+<option value="ext2">ext2</option>
+<option value="plain">plain</option>
+<option value="squashfs" SELECTED>squashfs</option>
+</select></TD></TR>
+<TR><TD> --packages: </TD><TD> <INPUT SIZE=150 NAME=www_packages></TD></TR>
+</TABLE>
+<BR>
+<INPUT type=submit value="Submit">
+</FORM>
+</BODY>
+</HTML>
+HTMLBLOCK
+
+else
+	##########################################
+	# Ok we made it here so we have parameters
+	# sent to the script.
+	##########################################
+	##########################################
+	# Collet parameters from the $QUERY_STRING
+	##########################################
+	#echo $QUERY_STRING
+	# sed "s/+/ /g" -> converts for spaces passed
+	# sed "s/%40/@/g" -> converts for @ symbol passed
+	# sed "s/%3A/:/g" -> converts for : sybmol passed
+	# sed "s/%2F/\//g" -> converts for / symbol passed
+	WWW_REPLY_TO_EMAIL=`echo "$QUERY_STRING" | grep -oE "(^|[?&])www_reply_to_email=[0-9,a-z,A-Z,.,%,-]+" | sed "s/%40/@/g" | cut -f 2 -d "=" | head -n1`
+	WWW_PACKAGES_LISTS=`echo "$QUERY_STRING" | grep -oE "(^|[?&])www_packages_lists=[a-z]+" | cut -f 2 -d "=" | head -n1`
+	WWW_BINARY_IMAGE=`echo "$QUERY_STRING" | grep -oE "(^|[?&])www_binary_image=[a-z]+" | cut -f 2 -d "=" | head -n1`
+	WWW_DISTRIBUTION=`echo "$QUERY_STRING" | grep -oE "(^|[?&])www_distribution=[a-z]+" | cut -f 2 -d "=" | head -n1`
+	WWW_PACKAGES=`echo "$QUERY_STRING" | grep -oE "(^|[?&])www_packages=[[0-9,a-z,A-Z,.,_,-]+" | sed "s/+/ /g" | cut -f 2 -d "="`
+	WWW_FILESYSTEM=`echo "$QUERY_STRING" | grep -oE "(^|[?&])www_filesystem=[0-9,a-z]+" | cut -f 2 -d "=" | head -n1`
+	
+	##########################################
+	# Set the build number
+	# This is crude but should get the average
+	# site by until someone else wanted to mess 
+	# with.
+	##########################################
+	WWW_BUILD_ID=`date +%Y%m%d%H%M%S`
+
+	##########################################
+	# Start sending HTML
+	##########################################
+	cat << HTMLBLOCK
+<BR><H2>Your build id is ${WWW_BUILD_ID}. We shall begin the build attempt shortly. You will be notified when the attempt has completed.</H2>
+The parameters you submitted are:
+<BR>Email - ${WWW_REPLY_TO_EMAIL}
+<BR>--packages-lists ${WWW_PACKAGES_LISTS}
+<BR>--distibution ${WWW_DISTRIBUTION}
+<BR>--binary-image ${WWW_BINARY_IMAGE}
+<BR>--filesystem: ${WWW_FILESYSTEM}
+<BR>--packages ${WWW_PACKAGES}
+<BR><H2>Thank you for your submission. </H2>
+</BODY>
+</HTML>
+HTMLBLOCK
+
+	##########################################
+	# Set the variables to pass to the cron job
+	# for processing. 
+	##########################################
+	echo `whoami`
+	echo "WWW_LIVE_PARAMETERS=\"${WWW_MAKE_LIVE_PARAMETERS}\"" > /tmp/${WWW_BUILD_ID}.wdl
+	echo "WWW_REPLY_TO_EMAIL=\"${WWW_REPLY_TO_EMAIL}\"" >> /tmp/${WWW_BUILD_ID}.wdl
+
+	#{ make-live -r ${WWW_WOKR_PATH}${WWW_BUILD_ID} --mirror-build ${WWW_MIRROR_BUILD} --packages-lists ${WWW_PACKAGES_LISTS} --binary-image ${WWW_BINARY_IMAGE} --distibution ${WWW_DISTRIBUTION} --filesystem ${WWW_FILESYSTEM} --packages "${WWW_PACKAGES}"; echo "Returned $? at $(date)"; } 2>&1 | mail -s "Your debian-live build with id - ${WWW_BUILD_ID}" ${WWW_REPLY_TO_EMAIL}
+fi  
+




More information about the Debian-live-changes mailing list