From: Michael Smith Date: Sun, 8 Jul 2007 22:57:15 +0000 (+0000) Subject: Made build-check return more appropriate exits codes. X-Git-Tag: release/1.79.1~6^2~2002 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=71cb442c6e0f51b4e49c1214e103af9d3dff5018;p=docbook-dsssl Made build-check return more appropriate exits codes. --- diff --git a/releasetools/build-check b/releasetools/build-check index a624eea55..fd3928fe9 100644 --- a/releasetools/build-check +++ b/releasetools/build-check @@ -1,11 +1,20 @@ #!/bin/sh # $Id$ +grep=egrep LOGFILENAME=LOG -if [ -f $LOGFILENAME ] -then # FIXME: This regexp may not catch all error messages emitted; # probably should be refined with a more complete regexp. - egrep -i "error|fail|\*[^.]" $LOGFILENAME +errorRegexp="error|fail|\*[^.]" +if [ -f $LOGFILENAME ] +then + errors=$($grep -i $errorRegexp $LOGFILENAME) + if [ -z "$errors" ] + then + exit 0 + else + $grep -i "error|fail|\*[^.]" $LOGFILENAME + exit 1 + fi else echo echo "No $LOGFILENAME file found."