diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | pbuildd/README | 8 | ||||
-rwxr-xr-x | pbuildd/build-agent.sh | 23 | ||||
-rwxr-xr-x | pbuildd/remote-buildd.sh | 98 |
4 files changed, 135 insertions, 0 deletions
@@ -1,3 +1,9 @@ +2004-08-12 Junichi Uekawa <dancer@debian.org> + + * pbuildd/remote-buildd.sh: files from 'compiler' distributed pbuilder setup + * pbuildd/build-agent.sh: files from 'compiler' + * pbuildd/README: Added + 2004-08-08 Junichi Uekawa <dancer@debian.org> * pbuildd/buildd.sh: Applied patch from Roland Stigge. diff --git a/pbuildd/README b/pbuildd/README new file mode 100644 index 0000000..cc2828c --- /dev/null +++ b/pbuildd/README @@ -0,0 +1,8 @@ +This directory contains examples for running pbuilder on +multiple hosts. + +This is the configuration used in 'compiler' system. + + +build-agent.sh -- the agent on the master side +remote-buildd.sh -- the buildd diff --git a/pbuildd/build-agent.sh b/pbuildd/build-agent.sh new file mode 100755 index 0000000..3864e82 --- /dev/null +++ b/pbuildd/build-agent.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# accept host name as $1 +# return unbuilt package, and reserve the package for building. + +# exit 1 if no more package is available. +# 2004 1 12, Junichi Uekawa + + +cd /game/buildd/ + +#build agent for pbuilder +for A in $( zcat /mirror/debian/dists/sid/main/source/Sources.gz | sed -n 's/^Package: //p' | cut -d\ -f1|sort | uniq | bogosort -n ); do + #waitingroutine + if [ $(find -name $A.log | wc -l ) != "0" ]; then + echo Already build tried for "$A" >&2 + else + echo $A + echo "$1 $(date)" > WORKING/$A.log + exit 0 + fi +done +exit 1 + diff --git a/pbuildd/remote-buildd.sh b/pbuildd/remote-buildd.sh new file mode 100755 index 0000000..4fc4d81 --- /dev/null +++ b/pbuildd/remote-buildd.sh @@ -0,0 +1,98 @@ +#!/bin/bash +# all-rebuilder script. +# remote-agent. runs on remote machine and runs with master node. +# 2004 01 12 + +set -e + +. buildd-config.sh + +NOBUILDDEP=${BASEDIRECTORY}/FAILED/NOBUILDDEP +FAILED=${BASEDIRECTORY}/FAILED +DEPWAIT=${BASEDIRECTORY}/DEPWAIT +SUCCESS=${BASEDIRECTORY}/SUCCESS +DEPWAIT=${BASEDIRECTORY}/DEPWAIT +mkdir "$FAILED" || true +mkdir "$DEPWAIT" || true +mkdir "$SUCCESS" || true +mkdir "$DEPWAIT" || true +mkdir ${BASEDIRECTORY}/WORKING || true +mkdir ${BASEDIRECTORY}/STATUS || true +mkdir "$NOBUILDDEP" || true +BUILDRESULTDIR=${PWD}/RESULT-deb +mkdir "$BUILDRESULTDIR" || true + +STATUSFILE=${BASEDIRECTORY}/STATUS/$(hostname)-$$ +BUILDTMP=${BASEDIRECTORY}/tmp-b-$(hostname)-$$ + +function status () { + echo "$@" > $STATUSFILE + echo "$@" +} + +function buildone() { + local PROGNAME="$1" + local LOGFILE=${BASEDIRECTORY}/WORKING/"$PROGNAME.log" + + + # this part needs to be atomic + status "considering $PROGNAME" + if grep "$PROGNAME" avoidlist; then + echo Skip. + return + fi + if echo "$PROGNAME" | grep "^kernel-image"; then + echo I hate kernel images. + return + fi + + # end of atomic. + + status "building $PROGNAME" + mkdir $BUILDTMP || true + ( + cd $BUILDTMP + apt-get source -d $PROGNAME + if /usr/sbin/pbuilder build --hookdir "${HOOKDIR}" --buildresult . --logfile "$LOGFILE" *.dsc; then + scp "$LOGFILE" "$MASTER:$SUCCESS" + mv "$LOGFILE" "$SUCCESS" + echo Build successful + else + if grep "^E: pbuilder: Could not satisfy build-dependency." $LOGFILE > /dev/null; then + scp "$LOGFILE" "$MASTER:$DEPWAIT" + mv "$LOGFILE" "$DEPWAIT" + echo Dependency cannot be satisfied. + elif [ $(awk '/ -> Attempting to parse the build-deps/,/^ -> Finished parsing the build-deps/{print $0}' $LOGFILE | wc -l ) = "2" ]; then + echo "Missing build-deps" + scp "$LOGFILE" "$MASTER:$NOBUILDDEP" + mv "$LOGFILE" "$NOBUILDDEP" + elif grep '^E: Could not satisfy build-dependency' "$LOGFILE" > /dev/null ; then + echo "Build-dep wait" + scp "$LOGFILE" "$MASTER:$DEPWAIT" + mv "$LOGFILE" "$DEPWAIT" + else + cat "$LOGFILE" | fsh $MASTER mail -s "\"pbuilder-FTBFS [$(hostname)] $(basename $LOGFILE) \"" dancer-pbuildlog@netfort.gr.jp + scp "$LOGFILE" "$MASTER:$FAILED" + mv "$LOGFILE" "$FAILED" + echo Build failed + fi + fi + ) + status "finished building $PROGNAME" + rm -rf $BUILDTMP; +} + + +$ROOTCOMMAND dselect update +$ROOTCOMMAND /usr/sbin/pbuilder update +#pbuilder-user-mode-linux update + + +while sleep 1s; do + A=$( ssh $MASTER /game/buildd/build-agent.sh $(hostname ) ); + if [ $? = 1 ]; then + exit ; + fi + buildone $A +done + |