#!/bin/bash LOG=${1} if [ "xx${PARSELOG_ALWAYS}xx"=!"xxyxx" ]; then if [ -f ${LOG}.parsed ]; then cat ${LOG}.parsed exit 0 fi fi { #BUILD_FAIL=`grep '\[BUILD FAILED\]' ${LOG} | wc -l` NUM_FAIL=`grep '\[.* FAILED\]' ${LOG} | wc -l` NUM_OK=`grep '\[TEST SUCCESSFUL\]' ${LOG} | wc -l` REVISION=`awk '/^Revision:/ { print $2; exit}' $LOG` REPO=`awk '/^Repo:/ { print $2; exit}' $LOG` if [ -f ${LOG}.lock ]; then BUILD_STATUS="build in progress..." elif (($NUM_FAIL==0)); then BUILD_STATUS="OK" else BUILD_STATUS="broken!" fi echo "

Revision: ${REVISION} Status: ${BUILD_STATUS}

" svn log --incremental -v -l 1 ${REPO}@${REVISION} | sed -e 's/$/
/' echo "------------------------------------------------------------------------
" if (($NUM_FAIL==0)); then true else echo "
Failed builds/tests:
" grep '\[.* FAILED\]' ${LOG} | uniq | sed -e 's/$/
/' fi } | tee ${1}.parsed