diff options
author | Bruce Momjian <bruce@momjian.us> | 2018-07-28 15:34:06 -0400 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2018-07-28 15:34:06 -0400 |
commit | 03131abe9b24a9806987f356da53a7a2440f3259 (patch) | |
tree | 01a498307d9c210fa97a5627ab2d5ab7b205f38d | |
parent | a326ca75b3296747bd70d62fa550b6fe004ecd92 (diff) |
pgtest: run clean, build, and check stages separately
This allows for cleaner error reporting.
Backpatch-through: 9.5
-rwxr-xr-x | src/tools/pgtest | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/tools/pgtest b/src/tools/pgtest index b16a798470b..70f6a62ad02 100755 --- a/src/tools/pgtest +++ b/src/tools/pgtest @@ -19,15 +19,25 @@ mkdir /tmp/$$ TMP="/tmp/$$" if [ "X$1" != "X-n" ] -then PGCLEAN=clean -else shift +then CLEAN="Y" +else CLEAN="" + shift fi rm -f tmp_install/log/install.log # Run "make check" and store return code in $TMP/ret. # Display output but also capture it in $TMP/0. -($MAKE "$@" $PGCLEAN check 2>&1; echo "$?" > $TMP/ret) | tee $TMP/0 +( + if [ "$CLEAN" ] + then $MAKE "$@" clean 2>&1 + echo "$?" > $TMP/ret + fi + if [ $(cat $TMP/ret) -eq 0 ] + then $MAKE "$@" 2>&1 && $MAKE "$@" check 2>&1 + echo "$?" > $TMP/ret + fi +) | tee $TMP/0 # Grab possible warnings from install.log [ -e tmp_install/log/install.log ] && cat tmp_install/log/install.log >> $TMP/0 |