aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorMark Linimon <linimon@FreeBSD.org>2010-06-25 23:27:16 +0000
committerMark Linimon <linimon@FreeBSD.org>2010-06-25 23:27:16 +0000
commit2e131db722c648ec6c22745468b937ab3da8631c (patch)
tree49ca1ff1a5a55523c8ad542e60fbc7a61a0b5e21 /Tools
parent2cff86f1e99f44cc01030419a01b39ba2b10e806 (diff)
downloadports-2e131db722c648ec6c22745468b937ab3da8631c.tar.gz
ports-2e131db722c648ec6c22745468b937ab3da8631c.zip
Generalize the packge building scripts to be able to be run on more than
one 'head' node, rather than just pointyhat itself. Constants are factored out into installation-specific files known as portbuild/conf/server.conf and portbuild/conf/client.conf. There is only one server.conf file. Individual <arch> directories may have their own client.conf files, or may symlink to ../conf/client.conf. Feature safe: yes
Notes
Notes: svn path=/head/; revision=256992
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/portbuild/scripts/pdispatch20
1 files changed, 11 insertions, 9 deletions
diff --git a/Tools/portbuild/scripts/pdispatch b/Tools/portbuild/scripts/pdispatch
index 893b6ade6fa2..4f1a134a9850 100755
--- a/Tools/portbuild/scripts/pdispatch
+++ b/Tools/portbuild/scripts/pdispatch
@@ -1,10 +1,13 @@
#!/bin/sh
+# $FreeBSD$
+
#
# pdispatch <arch> <branch> <buildid> <host> <command> <package.tbz> [<args> ...]
#
-# Dispatch the job to a host via the ptimeout script.
+# server-side script to dispatch the job to a host via the ptimeout script.
pb=/var/portbuild
+
arch=$1
branch=$2
buildid=$3
@@ -14,14 +17,13 @@ shift 5
pbab=${pb}/${arch}/${branch}
+. ${pb}/conf/server.conf
. ${pb}/${arch}/portbuild.conf
. ${pb}/scripts/buildenv
-# wait 100 hours maximum
-timeout=360000
-# number of lines of log to send
-loglength=1000
-hdrlength=6
+timeout=${PDISPATCH_TIMEOUT}
+loglength=${PDISPATCH_LOGLENGTH}
+hdrlength=${PDISPATCH_HDRLENGTH}
buildid=$(resolve ${pb} ${arch} ${branch} ${buildid})
if [ -z "${buildid}" ]; then
@@ -167,7 +169,7 @@ if [ "${error}" = 0 ]; then
if grep -q "^list of .*file" ${log}; then
buildlogdir=$(realpath ${builddir}/logs/)
baselogdir=$(basename ${buildlogdir})
- (sed -e '/^build started/,$d' $log;echo;echo "For the full build log, see"; echo; echo " http://${master}/errorlogs/${arch}-errorlogs/${baselogdir}/$(basename $log)";echo;sed -e '1,/^=== Checking filesystem state/d' $log) | mail -s "${pkgname} pkg-plist errors on ${arch} ${branch}" ${mailto}
+ (sed -e '/^build started/,$d' $log;echo;echo "For the full build log, see"; echo; echo " http://${MASTER_URL}/errorlogs/${arch}-errorlogs/${baselogdir}/$(basename $log)";echo;sed -e '1,/^=== Checking filesystem state/d' $log) | mail -s "${pkgname} pkg-plist errors on ${arch} ${branch}" ${mailto}
fi
else
log=${builddir}/errors/${pkgname}.log
@@ -176,9 +178,9 @@ else
buildlogdir=$(realpath ${builddir}/logs/)
baselogdir=$(basename ${buildlogdir})
if [ $(wc -l ${log} | awk '{print $1}') -le $((loglength + hdrlength)) ]; then
- (echo "You can also find this build log at"; echo; echo " http://${master}/errorlogs/${arch}-errorlogs/${baselogdir}/$(basename $log)";echo;cat ${log}) | mail -s "${pkgname} failed on ${arch} ${branch}" ${mailto}
+ (echo "You can also find this build log at"; echo; echo " http://${MASTER_URL}/errorlogs/${arch}-errorlogs/${baselogdir}/$(basename $log)";echo;cat ${log}) | mail -s "${pkgname} failed on ${arch} ${branch}" ${mailto}
else
- (echo "Excerpt from the build log at"; echo; echo " http://${master}/errorlogs/${arch}-errorlogs/${baselogdir}/$(basename $log)";echo;sed -e '/^build started/,$d' $log;echo;echo " [... lines trimmed ...]";echo;tail -${loglength} ${log}) | mail -s "${pkgname} failed on ${arch} ${branch}" ${mailto}
+ (echo "Excerpt from the build log at"; echo; echo " http://${MASTER_URL}/errorlogs/${arch}-errorlogs/${baselogdir}/$(basename $log)";echo;sed -e '/^build started/,$d' $log;echo;echo " [... lines trimmed ...]";echo;tail -${loglength} ${log}) | mail -s "${pkgname} failed on ${arch} ${branch}" ${mailto}
fi
fi
lockf -k ${pbab}/failure.lock ${pb}/scripts/buildfailure ${arch} ${branch} ${buildid} ${pkgname}