diff options
author | linimon <linimon@FreeBSD.org> | 2007-12-24 22:25:42 +0800 |
---|---|---|
committer | linimon <linimon@FreeBSD.org> | 2007-12-24 22:25:42 +0800 |
commit | 84acb7fd4042e5642e8216c5d16150d594637738 (patch) | |
tree | b060c0408fa3bca8acdde3d8e43e16ac7a08d45a /Tools | |
parent | 13bcdb8d1d97a574ce8b581f0255be74ebc7934d (diff) | |
download | freebsd-ports-gnome-84acb7fd4042e5642e8216c5d16150d594637738.tar.gz freebsd-ports-gnome-84acb7fd4042e5642e8216c5d16150d594637738.tar.zst freebsd-ports-gnome-84acb7fd4042e5642e8216c5d16150d594637738.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
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/portbuild/scripts/pdispatch | 11 |
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 |