]> granicus.if.org Git - docbook-dsssl/commitdiff
Made build-check return more appropriate exits codes.
authorMichael Smith <xmldoc@users.sourceforge.net>
Sun, 8 Jul 2007 22:57:15 +0000 (22:57 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Sun, 8 Jul 2007 22:57:15 +0000 (22:57 +0000)
releasetools/build-check

index a624eea552f0c75eea32a58c057a333980947c9a..fd3928fe904308af0e75fb4e2188b42ff1922f06 100644 (file)
@@ -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."