From 71cb442c6e0f51b4e49c1214e103af9d3dff5018 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Sun, 8 Jul 2007 22:57:15 +0000 Subject: [PATCH] Made build-check return more appropriate exits codes. --- releasetools/build-check | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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." -- 2.50.1