mirror of
https://github.com/postgres/postgres.git
synced 2025-08-17 01:02:17 +03:00
Fix headerscheck and cpluspluscheck's exit codes.
For the benefit of CI, which started running these header check scripts
in its CompilerWarnings task in commit 81b9f23c9c
, they should report
failure if any individual header failed to compile.
Reviewed-by: Andrew Dunstan <andrew@dunslane.net>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/CA%2BhUKGKtDwPo9wzKgbStDwfOhEpywMc6PQofio8fAHR7yUjgxw%40mail.gmail.com
This commit is contained in:
@@ -52,6 +52,8 @@ tmp=`mktemp -d /tmp/$me.XXXXXX`
|
|||||||
|
|
||||||
trap 'rm -rf $tmp' 0 1 2 3 15
|
trap 'rm -rf $tmp' 0 1 2 3 15
|
||||||
|
|
||||||
|
exit_status=0
|
||||||
|
|
||||||
# Scan all of src/ and contrib/ for header files.
|
# Scan all of src/ and contrib/ for header files.
|
||||||
for f in `cd "$srcdir" && find src contrib -name '*.h' -print`
|
for f in `cd "$srcdir" && find src contrib -name '*.h' -print`
|
||||||
do
|
do
|
||||||
@@ -167,9 +169,13 @@ do
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
# Run the test.
|
# Run the test.
|
||||||
${CXX:-g++} -I $builddir -I $srcdir \
|
if ! ${CXX:-g++} -I $builddir -I $srcdir \
|
||||||
-I $builddir/src/include -I $srcdir/src/include \
|
-I $builddir/src/include -I $srcdir/src/include \
|
||||||
-I $builddir/src/interfaces/libpq -I $srcdir/src/interfaces/libpq \
|
-I $builddir/src/interfaces/libpq -I $srcdir/src/interfaces/libpq \
|
||||||
$EXTRAINCLUDES $EXTRAFLAGS $CXXFLAGS -c $tmp/test.cpp
|
$EXTRAINCLUDES $EXTRAFLAGS $CXXFLAGS -c $tmp/test.cpp
|
||||||
|
then
|
||||||
|
exit_status=1
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
exit $exit_status
|
||||||
|
@@ -48,6 +48,8 @@ tmp=`mktemp -d /tmp/$me.XXXXXX`
|
|||||||
|
|
||||||
trap 'rm -rf $tmp' 0 1 2 3 15
|
trap 'rm -rf $tmp' 0 1 2 3 15
|
||||||
|
|
||||||
|
exit_status=0
|
||||||
|
|
||||||
# Scan all of src/ and contrib/ for header files.
|
# Scan all of src/ and contrib/ for header files.
|
||||||
for f in `cd "$srcdir" && find src contrib -name '*.h' -print`
|
for f in `cd "$srcdir" && find src contrib -name '*.h' -print`
|
||||||
do
|
do
|
||||||
@@ -150,9 +152,13 @@ do
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
# Run the test.
|
# Run the test.
|
||||||
${CC:-gcc} $CPPFLAGS $CFLAGS -I $builddir -I $srcdir \
|
if ! ${CC:-gcc} $CPPFLAGS $CFLAGS -I $builddir -I $srcdir \
|
||||||
-I $builddir/src/include -I $srcdir/src/include \
|
-I $builddir/src/include -I $srcdir/src/include \
|
||||||
-I $builddir/src/interfaces/libpq -I $srcdir/src/interfaces/libpq \
|
-I $builddir/src/interfaces/libpq -I $srcdir/src/interfaces/libpq \
|
||||||
$EXTRAINCLUDES $EXTRAFLAGS -c $tmp/test.c -o $tmp/test.o
|
$EXTRAINCLUDES $EXTRAFLAGS -c $tmp/test.c -o $tmp/test.o
|
||||||
|
then
|
||||||
|
exit_status=1
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
exit $exit_status
|
||||||
|
Reference in New Issue
Block a user