[Debian-live-changes] r1827 - in dists/trunk/live-webhelper: . scripts
daniel at alioth.debian.org
daniel at alioth.debian.org
Mon May 28 08:04:54 UTC 2007
Author: daniel
Date: 2007-05-28 08:04:54 +0000 (Mon, 28 May 2007)
New Revision: 1827
Added:
dists/trunk/live-webhelper/scripts/
dists/trunk/live-webhelper/scripts/cgi
dists/trunk/live-webhelper/scripts/cron
dists/trunk/live-webhelper/scripts/default
Removed:
dists/trunk/live-webhelper/cron
dists/trunk/live-webhelper/default
dists/trunk/live-webhelper/live-webhelper
Modified:
dists/trunk/live-webhelper/Makefile
Log:
Modified: dists/trunk/live-webhelper/Makefile
===================================================================
--- dists/trunk/live-webhelper/Makefile 2007-05-28 08:01:37 UTC (rev 1826)
+++ dists/trunk/live-webhelper/Makefile 2007-05-28 08:04:54 UTC (rev 1827)
@@ -5,7 +5,7 @@
all: build
test:
- set -e; for SCRIPT in cron default live-webhelper; \
+ set -e; for SCRIPT in scripts/*; \
do \
sh -n $$SCRIPT; \
done
@@ -15,9 +15,9 @@
install: test
# Installing executables
- install -D -m 0755 cron $(DESTDIR)/etc/cron.d/live-webhelper
- install -D -m 0644 default $(DESTDIR)/etc/default/live-webhelper
- install -D -m 0755 live-webhelper $(DESTDIR)/usr/lib/cgi-bin/live-webhelper
+ install -D -m 0755 scripts/cgi $(DESTDIR)/usr/lib/cgi-bin/live-webhelper
+ install -D -m 0755 scripts/cron $(DESTDIR)/etc/cron.d/live-webhelper
+ install -D -m 0644 scripts/default $(DESTDIR)/etc/default/live-webhelper
# Installing templates
mkdir -p $(DESTDIR)/usr/share/live-webhelper/templates
Deleted: dists/trunk/live-webhelper/cron
===================================================================
--- dists/trunk/live-webhelper/cron 2007-05-28 08:01:37 UTC (rev 1826)
+++ dists/trunk/live-webhelper/cron 2007-05-28 08:04:54 UTC (rev 1827)
@@ -1,208 +0,0 @@
-#!/bin/sh
-
-# live-webhelper - web-interface to live-helper
-# Copyright (C) 2007 Richard Nelson <rjent at rjent.pair.com>
-# Copyright (C) 2007 Daniel Baumann <daniel at debian.org>
-#
-# live-webhelper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
-# This is free software, and you are welcome to redistribute it
-# under certain conditions; see COPYING for details.
-
-# Reading defaults
-if [ -r /etc/default/live-webhelper ]
-then
- . /etc/default/live-webhelper
-else
- echo "E: /etc/default/live-webhelper missing"
- exit 1
-fi
-
-# Exit if disabled
-if [ "${WEBBUILD}" != "enabled" ]
-then
- exit 0
-fi
-
-# Checking lock file
-if [ -f /var/lock/live-webhelper.lock ]
-then
- echo "E: live-webhelper already/still running."
- exit 1
-fi
-
-# Creating lock trap
-trap "test -f /var/lock/live-webhelper.lock && rm -f /var/lock/live-webhelper.lock; exit 0" 0 1 2 3 9 15
-
-# Creating lock file
-touch /var/lock/live-webhelper.lock
-
-# Cleanup old builds: cron should be run at least once per hour to take effect
-if ls "${DESTDIR}"/`date -d yesterday +%Y%m%d.%H`* &> /dev/null
-then
- rm -rf "${DESTDIR}"/`date -d yesterday +%Y%m%d.%H`*
-
- echo "`date +%b\ %d\ %H:%M:%S` ${HOSTNAME} live-webhelper: remove web build (`date -d yesterday +%Y%m%d.%H`)." >> /var/log/live
-fi
-
-# Ok from here spin through the live-webhelper files we have waiting to build
-if ls "${TEMPDIR}"/*.build &> /dev/null
-then
- for FILE in "${TEMPDIR}"/*.build
- do
- # Reading build file
- . "${FILE}"
-
- echo "`date +%b\ %d\ %H:%M:%S` ${HOSTNAME} live-webhelper: begin web build (${BUILD})." >> /var/log/live
-
- # Assembling standard options
- if [ -n "${BINARY_IMAGE}" ]
- then
- LIVE_OPTIONS="${LIVE_OPTIONS} --binary-images ${BINARY_IMAGE}"
- fi
-
- if [ -n "${DISTRIBUTION}" ]
- then
- LIVE_OPTIONS="${LIVE_OPTIONS} --distribution ${DISTRIBUTION}"
- fi
-
- if [ -n "${PACKAGES}" ]
- then
- LIVE_OPTIONS="${LIVE_OPTIONS} --packages ${PACKAGES}"
- fi
-
- if [ -n "${PACKAGES_LISTS}" ]
- then
- LIVE_OPTIONS="${LIVE_OPTIONS} --packages-lists ${PACKAGES_LISTS}"
- fi
-
- # Assembling chroot options
- if [ -n "${CHROOT_FILESYSTEM}" ]
- then
- LIVE_OPTIONS="${LIVE_OPTIONS} --chroot-filesystem ${CHROOT_FILESYSTEM}"
- fi
-
- # Assembling binary options
- if [ -n "${ISO_APPLICATION}" ]
- then
- LIVE_OPTIONS="${LIVE_OPTIONS} --iso-application ${ISO_APPLICATION}"
- fi
-
- if [ -n "${ISO_PREPARER}" ]
- then
- LIVE_OPTIONS="${LIVE_OPTIONS} --iso-preparer ${ISO_PREPARER}"
- fi
-
- if [ -n "${ISO_PUBLISHER}" ]
- then
- LIVE_OPTIONS="${LIVE_OPTIONS} --iso-publisher ${ISO_PUBLISHER}"
- fi
-
- if [ -n "${ISO_VOLUME}" ]
- then
- LIVE_OPTIONS="${LIVE_OPTIONS} --iso-volume ${ISO_VOLUME}"
- fi
-
- # Assembling other options
- if [ -n "${MIRROR_BOOTSTRAP}" ]
- then
- LIVE_OPTIONS="${LIVE_OPTIONS} --mirror-bootstrap ${MIRROR_BOOTSTRAP}"
- fi
-
- if [ -n "${MIRROR_BOOTSTRAP_SECURITY}" ]
- then
- LIVE_OPTIONS="${LIVE_OPTIONS} --mirror-bootstrap-security ${MIRROR_BOOTSTRAP_SECURITY}"
- fi
-
- if [ -n "${MIRROR_BINARY}" ]
- then
- LIVE_OPTIONS="${LIVE_OPTIONS} --mirror-binary ${MIRROR_BINARY}"
- fi
-
- if [ -n "${MIRROR_BINARY_SECURITY}" ]
- then
- LIVE_OPTIONS="${LIVE_OPTIONS} --mirror-binary-security ${MIRROR_BINARY_SECURITY}"
- fi
-
- # Creating build directory
- mkdir -p "${TEMPDIR}"/"${BUILD}"
-
- DATE_START="`date -R`"
- echo "Begin: ${DATE_START}" > "${TEMPDIR}"/"${BUILD}"/log.txt
-
- # Generating image
- cd "${TEMPDIR}"/"${BUILD}"
- make-live ${LIVE_OPTIONS} >> "${TEMPDIR}"/"${BUILD}"/log.txt 2>&1
- ERROR="${?}"
-
- DATE_END="`date -R`"
- echo "End: ${DATE_END}" >> "${TEMPDIR}"/"${BUILD}"/log.txt
-
- # Creating image directory
- mkdir -p "${DESTDIR}"/"${BUILD}"
-
- # Creating mail
- if [ "${ERROR}" -eq "0" ]
- then
- sed -e "s/BUILD/${BUILD}/g" \
- -e "s/EMAIL/${EMAIL}/" \
- -e "s/VERSION/${VERSION}/" \
- -e "s/DATE_START/${DATE_START}/" \
- -e "s/DATE_END/${DATE_END}/" \
- -e "s/STATUS/maybe-successful/" \
- -e "s#SERVER#${SERVER}#" \
- "${TEMPLATES}"/mail.txt > "${DESTDIR}"/"${BUILD}"/mail.txt
- else
- sed -e "s/BUILD/${BUILD}/g" \
- -e "s/EMAIL/${EMAIL}/" \
- -e "s/VERSION/${VERSION}/" \
- -e "s/DATE_START/${DATE_START}/" \
- -e "s/DATE_END/${DATE_END}/" \
- -e "s/STATUS/maybe-failed/" \
- -e "s#SERVER#${SERVER}#" \
- "${TEMPLATES}"/mail.txt > "${DESTDIR}"/"${BUILD}"/mail.txt
- fi
-
- # Moving binary image
- if ls "${TEMPDIR}"/"${BUILD}"/debian-live/binary.* &> /dev/null
- then
- mv "${TEMPDIR}"/"${BUILD}"/debian-live/binary.* "${DESTDIR}"/"${BUILD}"
- fi
-
- # Moving source image
- if ls "${TEMPDIR}"/"${BUILD}"/debian-live/source.* &> /dev/null
- then
- mv "${TEMPDIR}"/"${BUILD}"/debian-live/source.* "${DESTDIR}"/"${BUILD}"
- fi
-
- # Moving build
- mv "${TEMPDIR}"/"${BUILD}".build "${DESTDIR}"/"${BUILD}"/build
-
- # Moving log
- mv "${TEMPDIR}"/"${BUILD}"/log.txt "${DESTDIR}"/"${BUILD}"
-
- # Generating md5sum
- cd "${DESTDIR}"/"${BUILD}"
- md5sum * > md5sum.txt
- cd "${OLDPWD}"
-
- # Sending mail
- cat "${DESTDIR}"/"${BUILD}"/mail.txt | /usr/sbin/sendmail -t
-
- # Unmounting proc
- if [ -f "${TEMPDIR}"/"${BUILD}"/debian-live/chroot/proc/version ]
- then
- umount "${TEMPDIR}"/"${BUILD}"/debian-live/chroot/proc
- fi
-
- # Unmounting sysfs
- if [ -d "${TEMPDIR}"/"${BUILD}"/debian-live/chroot/sys/kernel ]
- then
- umount "${TEMPDIR}"/${BUILD}/debian-live/chroot/sys
- fi
-
- # Removing build directory
- rm -rf "${TEMPDIR}"/"${BUILD}"
-
- echo "`date +%b\ %d\ %H:%M:%S` ${HOSTNAME} live-webhelper: end web build (${BUILD})." >> /var/log/live
- done
-fi
Deleted: dists/trunk/live-webhelper/default
===================================================================
--- dists/trunk/live-webhelper/default 2007-05-28 08:01:37 UTC (rev 1826)
+++ dists/trunk/live-webhelper/default 2007-05-28 08:04:54 UTC (rev 1827)
@@ -1,16 +0,0 @@
-# Defaults for /etc/cron.daily/live-webhelper
-
-VERSION="1.0~a12"
-
-WEBBUILD="disabled"
-
-DESTDIR="/srv/debian-unofficial/ftp/debian-live/webhelper"
-TEMPLATES="/usr/share/live-webhelper/templates"
-TEMPDIR="/srv/tmp/live-webhelper"
-
-MIRROR_BOOTSTRAP="http://ftp.de.debian.org/debian/"
-MIRROR_BOOTSTRAP_SECURITY="http://ftp.de.debian.org/debian-security/"
-MIRROR_IMAGE="http://ftp.debian.org/debian/"
-MIRROR_IMAGE_SECURITY="http://security.debian.org/"
-
-SERVER="http://live.debian.net/webhelper"
Deleted: dists/trunk/live-webhelper/live-webhelper
===================================================================
--- dists/trunk/live-webhelper/live-webhelper 2007-05-28 08:01:37 UTC (rev 1826)
+++ dists/trunk/live-webhelper/live-webhelper 2007-05-28 08:04:54 UTC (rev 1827)
@@ -1,117 +0,0 @@
-#!/bin/sh
-
-# live-webhelper - web-interface to live-helper
-# Copyright (C) 2007 Richard Nelson <rjent at rjent.pair.com>
-# Copyright (C) 2007 Daniel Baumann <daniel at debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# On Debian systems, the complete text of the GNU General Public License
-# can be found in /usr/share/common-licenses/GPL file.
-
-# Sending http header
-echo "Content-type: text/html"
-echo
-
-# Reading defaults
-if [ -r /etc/default/live-webhelper ]
-then
- . /etc/default/live-webhelper
-else
- echo "E: /etc/default/live-webhelper missing"
- exit 1
-fi
-
-# Sending html header
-cat "${TEMPLATES}"/header.html
-
-# CGI
-if [ -z "${QUERY_STRING}" ]
-then
- # Sending html form
- cat "${TEMPLATES}"/form.html
-else
- # Converting spaces: sed "s/+/ /g"
- # Converting '@': sed "s/%40/@/g"
- # Converting ':': sed "s/%3A/:/g"
- # Converting '/': sed "s/%2F/\//g"
-
- # Filtering url parameters
- EMAIL="`echo ${QUERY_STRING} | grep -oE '(^|[?&])email=[0-9,a-z,A-Z,.,%,-]+' | sed 's/%40/@/g' | cut -f 2 -d '=' | head -n1`"
-
- BINARY_IMAGE="`echo ${QUERY_STRING} | grep -oE '(^|[?&])binary_image=[a-z]+' | cut -f 2 -d '=' | head -n1`"
- DISTRIBUTION="`echo ${QUERY_STRING} | grep -oE '(^|[?&])distribution=[a-z]+' | cut -f 2 -d '=' | head -n1`"
- PACKAGES_LISTS="`echo ${QUERY_STRING} | grep -oE '(^|[?&])packages_lists=[a-z,-]+' | cut -f 2 -d '=' | head -n1`"
- PACKAGES="`echo ${QUERY_STRING} | grep -oE '(^|[?&])packages=[0-9,a-z,A-Z,.,_,+,-]+' | sed 's/+/ /g' | cut -f 2 -d '=' | head -n1`"
-
- CHROOT_FILESYSTEM="`echo ${QUERY_STRING} | grep -oE '(^|[?&])chroot_filesystem=[0-9,a-z]+' | cut -f 2 -d '=' | head -n1`"
-
- ISO_APPLICATION="`echo ${QUERY_STRING} | grep -oE '(^|[?&])iso_application=[0-9,a-z,A-Z,.,_,+,-]+' | sed 's/+/ /g' | cut -f 2 -d '=' | head -n1`"
- ISO_PREPARER="`echo ${QUERY_STRING} | grep -oE '(^|[?&])iso_preparer=[0-9,a-z,A-Z,.,_,+,-]+' | sed 's/+/ /g' | cut -f 2 -d '=' | head -n1`"
- ISO_PUBLISHER="`echo ${QUERY_STRING} | grep -oE '(^|[?&])iso_publisher=[0-9,a-z,A-Z,.,_,+,-]+' | sed 's/+/ /g' | cut -f 2 -d '=' | head -n1`"
- ISO_VOLUME="`echo ${QUERY_STRING} | grep -oE '(^|[?&])iso_volume=[0-9,a-z,A-Z,.,_,+,-]+' | sed 's/+/ /g' | cut -f 2 -d '=' | head -n1`"
-
- # FIXME: filter invalid options
- unset QUERY_STRING
-
- # Getting build identifier
- BUILD="`date +%Y%m%d.%H%M%S.%N`"
-
- # Sending html confirmation
- sed -e "s/BUILD/${BUILD}/" \
- -e "s/EMAIL/${EMAIL}/" \
- -e "s/BINARY_IMAGE/${BINARY_IMAGE}/" \
- -e "s/DISTRIBUTION/${DISTRIBUTION}/" \
- -e "s/PACKAGES_LISTS/${PACKAGES_LISTS}/" \
- -e "s/PACKAGES/${PACKAGES}/" \
- -e "s/CHROOT_FILESYSTEM/${CHROOT_FILESYSTEM}/" \
- -e "s/ISO_APPLICATION/${ISO_APPLICATION}/" \
- -e "s/ISO_PREPARER/${ISO_PREPARER}/" \
- -e "s/ISO_PUBLISHER/${ISO_PUBLISHER}/" \
- -e "s/ISO_VOLUME/${ISO_VOLUME}/" \
- "${TEMPLATES}"/build.html
-
- # Creating temporary directory
- if [ ! -d "${TEMPDIR}" ]
- then
- mkdir -p "${TEMPDIR}"
- fi
-
-# Writing build file
-cat > "${TEMPDIR}"/"${BUILD}".build << EOF
-# live-webhelper ${VERSION} build file
-# `date -R`
-
-BUILD="${BUILD}"
-
-EMAIL="${EMAIL}"
-
-BINARY_IMAGE="${BINARY_IMAGE}"
-DISTRIBUTION="${DISTRIBUTION}"
-PACKAGES_LISTS="${PACKAGES_LISTS}"
-PACKAGES="${PACKAGES}"
-
-CHROOT_FILESYSTEM="${CHROOT_FILESYSTEM}"
-
-ISO_APPLICATION="${ISO_APPLICATION}"
-ISO_PREPARER="${ISO_PREPARER}"
-ISO_PUBLISHER="${ISO_PUBLISHER}"
-ISO_VOLUME="${ISO_VOLUME}"
-EOF
-
- echo "`date +%b\ %d\ %H:%M:%S` ${HOSTNAME} live-webhelper: add web build (${BUILD})." >> /var/log/live
-fi
-
-sed -e "s/VERSION/${VERSION}/" "${TEMPLATES}"/footer.html
Copied: dists/trunk/live-webhelper/scripts/cgi (from rev 1815, dists/trunk/live-webhelper/live-webhelper)
===================================================================
--- dists/trunk/live-webhelper/scripts/cgi (rev 0)
+++ dists/trunk/live-webhelper/scripts/cgi 2007-05-28 08:04:54 UTC (rev 1827)
@@ -0,0 +1,117 @@
+#!/bin/sh
+
+# live-webhelper - web-interface to live-helper
+# Copyright (C) 2007 Richard Nelson <rjent at rjent.pair.com>
+# Copyright (C) 2007 Daniel Baumann <daniel at debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# On Debian systems, the complete text of the GNU General Public License
+# can be found in /usr/share/common-licenses/GPL file.
+
+# Sending http header
+echo "Content-type: text/html"
+echo
+
+# Reading defaults
+if [ -r /etc/default/live-webhelper ]
+then
+ . /etc/default/live-webhelper
+else
+ echo "E: /etc/default/live-webhelper missing"
+ exit 1
+fi
+
+# Sending html header
+cat "${TEMPLATES}"/header.html
+
+# CGI
+if [ -z "${QUERY_STRING}" ]
+then
+ # Sending html form
+ cat "${TEMPLATES}"/form.html
+else
+ # Converting spaces: sed "s/+/ /g"
+ # Converting '@': sed "s/%40/@/g"
+ # Converting ':': sed "s/%3A/:/g"
+ # Converting '/': sed "s/%2F/\//g"
+
+ # Filtering url parameters
+ EMAIL="`echo ${QUERY_STRING} | grep -oE '(^|[?&])email=[0-9,a-z,A-Z,.,%,-]+' | sed 's/%40/@/g' | cut -f 2 -d '=' | head -n1`"
+
+ BINARY_IMAGE="`echo ${QUERY_STRING} | grep -oE '(^|[?&])binary_image=[a-z]+' | cut -f 2 -d '=' | head -n1`"
+ DISTRIBUTION="`echo ${QUERY_STRING} | grep -oE '(^|[?&])distribution=[a-z]+' | cut -f 2 -d '=' | head -n1`"
+ PACKAGES_LISTS="`echo ${QUERY_STRING} | grep -oE '(^|[?&])packages_lists=[a-z,-]+' | cut -f 2 -d '=' | head -n1`"
+ PACKAGES="`echo ${QUERY_STRING} | grep -oE '(^|[?&])packages=[0-9,a-z,A-Z,.,_,+,-]+' | sed 's/+/ /g' | cut -f 2 -d '=' | head -n1`"
+
+ CHROOT_FILESYSTEM="`echo ${QUERY_STRING} | grep -oE '(^|[?&])chroot_filesystem=[0-9,a-z]+' | cut -f 2 -d '=' | head -n1`"
+
+ ISO_APPLICATION="`echo ${QUERY_STRING} | grep -oE '(^|[?&])iso_application=[0-9,a-z,A-Z,.,_,+,-]+' | sed 's/+/ /g' | cut -f 2 -d '=' | head -n1`"
+ ISO_PREPARER="`echo ${QUERY_STRING} | grep -oE '(^|[?&])iso_preparer=[0-9,a-z,A-Z,.,_,+,-]+' | sed 's/+/ /g' | cut -f 2 -d '=' | head -n1`"
+ ISO_PUBLISHER="`echo ${QUERY_STRING} | grep -oE '(^|[?&])iso_publisher=[0-9,a-z,A-Z,.,_,+,-]+' | sed 's/+/ /g' | cut -f 2 -d '=' | head -n1`"
+ ISO_VOLUME="`echo ${QUERY_STRING} | grep -oE '(^|[?&])iso_volume=[0-9,a-z,A-Z,.,_,+,-]+' | sed 's/+/ /g' | cut -f 2 -d '=' | head -n1`"
+
+ # FIXME: filter invalid options
+ unset QUERY_STRING
+
+ # Getting build identifier
+ BUILD="`date +%Y%m%d.%H%M%S.%N`"
+
+ # Sending html confirmation
+ sed -e "s/BUILD/${BUILD}/" \
+ -e "s/EMAIL/${EMAIL}/" \
+ -e "s/BINARY_IMAGE/${BINARY_IMAGE}/" \
+ -e "s/DISTRIBUTION/${DISTRIBUTION}/" \
+ -e "s/PACKAGES_LISTS/${PACKAGES_LISTS}/" \
+ -e "s/PACKAGES/${PACKAGES}/" \
+ -e "s/CHROOT_FILESYSTEM/${CHROOT_FILESYSTEM}/" \
+ -e "s/ISO_APPLICATION/${ISO_APPLICATION}/" \
+ -e "s/ISO_PREPARER/${ISO_PREPARER}/" \
+ -e "s/ISO_PUBLISHER/${ISO_PUBLISHER}/" \
+ -e "s/ISO_VOLUME/${ISO_VOLUME}/" \
+ "${TEMPLATES}"/build.html
+
+ # Creating temporary directory
+ if [ ! -d "${TEMPDIR}" ]
+ then
+ mkdir -p "${TEMPDIR}"
+ fi
+
+# Writing build file
+cat > "${TEMPDIR}"/"${BUILD}".build << EOF
+# live-webhelper ${VERSION} build file
+# `date -R`
+
+BUILD="${BUILD}"
+
+EMAIL="${EMAIL}"
+
+BINARY_IMAGE="${BINARY_IMAGE}"
+DISTRIBUTION="${DISTRIBUTION}"
+PACKAGES_LISTS="${PACKAGES_LISTS}"
+PACKAGES="${PACKAGES}"
+
+CHROOT_FILESYSTEM="${CHROOT_FILESYSTEM}"
+
+ISO_APPLICATION="${ISO_APPLICATION}"
+ISO_PREPARER="${ISO_PREPARER}"
+ISO_PUBLISHER="${ISO_PUBLISHER}"
+ISO_VOLUME="${ISO_VOLUME}"
+EOF
+
+ echo "`date +%b\ %d\ %H:%M:%S` ${HOSTNAME} live-webhelper: add web build (${BUILD})." >> /var/log/live
+fi
+
+sed -e "s/VERSION/${VERSION}/" "${TEMPLATES}"/footer.html
Copied: dists/trunk/live-webhelper/scripts/cron (from rev 1815, dists/trunk/live-webhelper/cron)
===================================================================
--- dists/trunk/live-webhelper/scripts/cron (rev 0)
+++ dists/trunk/live-webhelper/scripts/cron 2007-05-28 08:04:54 UTC (rev 1827)
@@ -0,0 +1,208 @@
+#!/bin/sh
+
+# live-webhelper - web-interface to live-helper
+# Copyright (C) 2007 Richard Nelson <rjent at rjent.pair.com>
+# Copyright (C) 2007 Daniel Baumann <daniel at debian.org>
+#
+# live-webhelper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+# This is free software, and you are welcome to redistribute it
+# under certain conditions; see COPYING for details.
+
+# Reading defaults
+if [ -r /etc/default/live-webhelper ]
+then
+ . /etc/default/live-webhelper
+else
+ echo "E: /etc/default/live-webhelper missing"
+ exit 1
+fi
+
+# Exit if disabled
+if [ "${WEBBUILD}" != "enabled" ]
+then
+ exit 0
+fi
+
+# Checking lock file
+if [ -f /var/lock/live-webhelper.lock ]
+then
+ echo "E: live-webhelper already/still running."
+ exit 1
+fi
+
+# Creating lock trap
+trap "test -f /var/lock/live-webhelper.lock && rm -f /var/lock/live-webhelper.lock; exit 0" 0 1 2 3 9 15
+
+# Creating lock file
+touch /var/lock/live-webhelper.lock
+
+# Cleanup old builds: cron should be run at least once per hour to take effect
+if ls "${DESTDIR}"/`date -d yesterday +%Y%m%d.%H`* &> /dev/null
+then
+ rm -rf "${DESTDIR}"/`date -d yesterday +%Y%m%d.%H`*
+
+ echo "`date +%b\ %d\ %H:%M:%S` ${HOSTNAME} live-webhelper: remove web build (`date -d yesterday +%Y%m%d.%H`)." >> /var/log/live
+fi
+
+# Ok from here spin through the live-webhelper files we have waiting to build
+if ls "${TEMPDIR}"/*.build &> /dev/null
+then
+ for FILE in "${TEMPDIR}"/*.build
+ do
+ # Reading build file
+ . "${FILE}"
+
+ echo "`date +%b\ %d\ %H:%M:%S` ${HOSTNAME} live-webhelper: begin web build (${BUILD})." >> /var/log/live
+
+ # Assembling standard options
+ if [ -n "${BINARY_IMAGE}" ]
+ then
+ LIVE_OPTIONS="${LIVE_OPTIONS} --binary-images ${BINARY_IMAGE}"
+ fi
+
+ if [ -n "${DISTRIBUTION}" ]
+ then
+ LIVE_OPTIONS="${LIVE_OPTIONS} --distribution ${DISTRIBUTION}"
+ fi
+
+ if [ -n "${PACKAGES}" ]
+ then
+ LIVE_OPTIONS="${LIVE_OPTIONS} --packages ${PACKAGES}"
+ fi
+
+ if [ -n "${PACKAGES_LISTS}" ]
+ then
+ LIVE_OPTIONS="${LIVE_OPTIONS} --packages-lists ${PACKAGES_LISTS}"
+ fi
+
+ # Assembling chroot options
+ if [ -n "${CHROOT_FILESYSTEM}" ]
+ then
+ LIVE_OPTIONS="${LIVE_OPTIONS} --chroot-filesystem ${CHROOT_FILESYSTEM}"
+ fi
+
+ # Assembling binary options
+ if [ -n "${ISO_APPLICATION}" ]
+ then
+ LIVE_OPTIONS="${LIVE_OPTIONS} --iso-application ${ISO_APPLICATION}"
+ fi
+
+ if [ -n "${ISO_PREPARER}" ]
+ then
+ LIVE_OPTIONS="${LIVE_OPTIONS} --iso-preparer ${ISO_PREPARER}"
+ fi
+
+ if [ -n "${ISO_PUBLISHER}" ]
+ then
+ LIVE_OPTIONS="${LIVE_OPTIONS} --iso-publisher ${ISO_PUBLISHER}"
+ fi
+
+ if [ -n "${ISO_VOLUME}" ]
+ then
+ LIVE_OPTIONS="${LIVE_OPTIONS} --iso-volume ${ISO_VOLUME}"
+ fi
+
+ # Assembling other options
+ if [ -n "${MIRROR_BOOTSTRAP}" ]
+ then
+ LIVE_OPTIONS="${LIVE_OPTIONS} --mirror-bootstrap ${MIRROR_BOOTSTRAP}"
+ fi
+
+ if [ -n "${MIRROR_BOOTSTRAP_SECURITY}" ]
+ then
+ LIVE_OPTIONS="${LIVE_OPTIONS} --mirror-bootstrap-security ${MIRROR_BOOTSTRAP_SECURITY}"
+ fi
+
+ if [ -n "${MIRROR_BINARY}" ]
+ then
+ LIVE_OPTIONS="${LIVE_OPTIONS} --mirror-binary ${MIRROR_BINARY}"
+ fi
+
+ if [ -n "${MIRROR_BINARY_SECURITY}" ]
+ then
+ LIVE_OPTIONS="${LIVE_OPTIONS} --mirror-binary-security ${MIRROR_BINARY_SECURITY}"
+ fi
+
+ # Creating build directory
+ mkdir -p "${TEMPDIR}"/"${BUILD}"
+
+ DATE_START="`date -R`"
+ echo "Begin: ${DATE_START}" > "${TEMPDIR}"/"${BUILD}"/log.txt
+
+ # Generating image
+ cd "${TEMPDIR}"/"${BUILD}"
+ make-live ${LIVE_OPTIONS} >> "${TEMPDIR}"/"${BUILD}"/log.txt 2>&1
+ ERROR="${?}"
+
+ DATE_END="`date -R`"
+ echo "End: ${DATE_END}" >> "${TEMPDIR}"/"${BUILD}"/log.txt
+
+ # Creating image directory
+ mkdir -p "${DESTDIR}"/"${BUILD}"
+
+ # Creating mail
+ if [ "${ERROR}" -eq "0" ]
+ then
+ sed -e "s/BUILD/${BUILD}/g" \
+ -e "s/EMAIL/${EMAIL}/" \
+ -e "s/VERSION/${VERSION}/" \
+ -e "s/DATE_START/${DATE_START}/" \
+ -e "s/DATE_END/${DATE_END}/" \
+ -e "s/STATUS/maybe-successful/" \
+ -e "s#SERVER#${SERVER}#" \
+ "${TEMPLATES}"/mail.txt > "${DESTDIR}"/"${BUILD}"/mail.txt
+ else
+ sed -e "s/BUILD/${BUILD}/g" \
+ -e "s/EMAIL/${EMAIL}/" \
+ -e "s/VERSION/${VERSION}/" \
+ -e "s/DATE_START/${DATE_START}/" \
+ -e "s/DATE_END/${DATE_END}/" \
+ -e "s/STATUS/maybe-failed/" \
+ -e "s#SERVER#${SERVER}#" \
+ "${TEMPLATES}"/mail.txt > "${DESTDIR}"/"${BUILD}"/mail.txt
+ fi
+
+ # Moving binary image
+ if ls "${TEMPDIR}"/"${BUILD}"/debian-live/binary.* &> /dev/null
+ then
+ mv "${TEMPDIR}"/"${BUILD}"/debian-live/binary.* "${DESTDIR}"/"${BUILD}"
+ fi
+
+ # Moving source image
+ if ls "${TEMPDIR}"/"${BUILD}"/debian-live/source.* &> /dev/null
+ then
+ mv "${TEMPDIR}"/"${BUILD}"/debian-live/source.* "${DESTDIR}"/"${BUILD}"
+ fi
+
+ # Moving build
+ mv "${TEMPDIR}"/"${BUILD}".build "${DESTDIR}"/"${BUILD}"/build
+
+ # Moving log
+ mv "${TEMPDIR}"/"${BUILD}"/log.txt "${DESTDIR}"/"${BUILD}"
+
+ # Generating md5sum
+ cd "${DESTDIR}"/"${BUILD}"
+ md5sum * > md5sum.txt
+ cd "${OLDPWD}"
+
+ # Sending mail
+ cat "${DESTDIR}"/"${BUILD}"/mail.txt | /usr/sbin/sendmail -t
+
+ # Unmounting proc
+ if [ -f "${TEMPDIR}"/"${BUILD}"/debian-live/chroot/proc/version ]
+ then
+ umount "${TEMPDIR}"/"${BUILD}"/debian-live/chroot/proc
+ fi
+
+ # Unmounting sysfs
+ if [ -d "${TEMPDIR}"/"${BUILD}"/debian-live/chroot/sys/kernel ]
+ then
+ umount "${TEMPDIR}"/${BUILD}/debian-live/chroot/sys
+ fi
+
+ # Removing build directory
+ rm -rf "${TEMPDIR}"/"${BUILD}"
+
+ echo "`date +%b\ %d\ %H:%M:%S` ${HOSTNAME} live-webhelper: end web build (${BUILD})." >> /var/log/live
+ done
+fi
Copied: dists/trunk/live-webhelper/scripts/default (from rev 1815, dists/trunk/live-webhelper/default)
===================================================================
--- dists/trunk/live-webhelper/scripts/default (rev 0)
+++ dists/trunk/live-webhelper/scripts/default 2007-05-28 08:04:54 UTC (rev 1827)
@@ -0,0 +1,16 @@
+# Defaults for /etc/cron.daily/live-webhelper
+
+VERSION="1.0~a12"
+
+WEBBUILD="disabled"
+
+DESTDIR="/srv/debian-unofficial/ftp/debian-live/webhelper"
+TEMPLATES="/usr/share/live-webhelper/templates"
+TEMPDIR="/srv/tmp/live-webhelper"
+
+MIRROR_BOOTSTRAP="http://ftp.de.debian.org/debian/"
+MIRROR_BOOTSTRAP_SECURITY="http://ftp.de.debian.org/debian-security/"
+MIRROR_IMAGE="http://ftp.debian.org/debian/"
+MIRROR_IMAGE_SECURITY="http://security.debian.org/"
+
+SERVER="http://live.debian.net/webhelper"
More information about the Debian-live-changes
mailing list