aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorMark Linimon <linimon@FreeBSD.org>2007-12-24 14:25:42 +0000
committerMark Linimon <linimon@FreeBSD.org>2007-12-24 14:25:42 +0000
commit2c493361b066557b04c0d0132e049d50ecffe72b (patch)
treeae12d44f8b2ff7f4641298e6632b48a595a84521 /Tools
parent79bbc21af8713965bf9f90547c059a8abde62450 (diff)
downloadports-2c493361b066557b04c0d0132e049d50ecffe72b.tar.gz
ports-2c493361b066557b04c0d0132e049d50ecffe72b.zip
Add the standard 6-line header and URL to all build failure logs, not
just the plist ones. If the log is less than 1000 lines after the header, include it all; else, trim to last 1000 lines. This should help when deciding where to forward logs. Tested on: pointyhat
Notes
Notes: svn path=/head/; revision=204445
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/portbuild/scripts/pdispatch11
1 files changed, 10 insertions, 1 deletions
diff --git a/Tools/portbuild/scripts/pdispatch b/Tools/portbuild/scripts/pdispatch
index 078e9fe2c531..004228803391 100755
--- a/Tools/portbuild/scripts/pdispatch
+++ b/Tools/portbuild/scripts/pdispatch
@@ -13,6 +13,9 @@ shift
# wait 100 hours maximum
timeout=360000
+# number of lines of log to send
+loglength=1000
+hdrlength=6
branch=$1
command=$2
@@ -127,7 +130,13 @@ while `true`; do
log=${pb}/${arch}/${branch}/errors/${pkgname}.log
scp ${client_user}@${host}:${chroot}/tmp/${pkgname}.log ${log} || (echo ${chroot}@${host}; ssh -a -n ${client_user}@${host} ls -laR ${chroot}/tmp) | mail -s "${pkgname} logfile not found" ${mailto}
if ! grep -q "even though it is marked BROKEN" ${log}; then
- tail -1000 ${log} | mail -s "${pkgname} failed on ${arch} ${branch}" ${mailto}
+ buildlogdir=$(realpath ${pb}/${arch}/${branch}/logs/)
+ baselogdir=$(basename ${buildlogdir})
+ if [ `wc -l ${log} | awk '{print $1}'` -le `expr ${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}
+ 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}
+ fi
fi
lockf -k ${pb}/${arch}/${branch}/failure.lock ${pb}/scripts/buildfailure ${arch} ${branch} ${pkgname}
fi