The original `trap` lines in these scripts are incomplete: in case of
any signal, they delete the working directory but let the script run to
completion, which is useless because it will only proceed to complain
about the working directory being removed. Add `exit` there, with the
original exit value (not rm's).
Since this is mostly just cosmetic, no backpatch.
Discussion: https://postgr.es/m/
20220913181002.hzsosy7qkemb7ky7@alvherre.pgsql
# src/tools/find_static
-trap "rm -f /tmp/$$" 0 1 2 3 15
+trap "ret=$?; rm -rf /tmp/$$; exit $ret" 0 1 2 3 15
# This script finds functions that are either never called, or
# should be static.
command -v ctags >/dev/null || \
{ echo "'ctags' program not found" 1>&2; exit 1; }
-trap "rm -f /tmp/$$" 0 1 2 3 15
+trap "ret=$?; rm -rf /tmp/$$; exit $ret" 0 1 2 3 15
rm -f ./tags
IS_EXUBERANT=""
# Create temp directory.
tmp=`mktemp -d /tmp/$me.XXXXXX`
-trap 'rm -rf $tmp' 0 1 2 3 15
+trap "ret=$?; rm -rf $tmp; exit $ret" 0 1 2 3 15
exit_status=0
# Create temp directory.
tmp=`mktemp -d /tmp/$me.XXXXXX`
-trap 'rm -rf $tmp' 0 1 2 3 15
+trap "ret=$?; rm -rf $tmp; exit $ret" 0 1 2 3 15
exit_status=0
EXTRAINCLUDES="$python_includespec" ;;
src/interfaces/ecpg/*)
EXTRAINCLUDES="-I $builddir/src/interfaces/ecpg/include -I $srcdir/src/interfaces/ecpg/include" ;;
- src/backend/parser/*)
+ src/backend/parser/*)
EXTRAINCLUDES="-I $builddir/src/backend/parser/" ;;
- src/backend/utils/adt/*)
+ src/backend/utils/adt/*)
EXTRAINCLUDES="-I $builddir/src/backend/utils/adt/" ;;
*)
EXTRAINCLUDES="" ;;
[ ! -d src ] && echo "This must be run from the top of the PostgreSQL source tree" 1>&2 && exit 1
-trap "rm -rf /tmp/$$" 0 1 2 3 15
+trap "ret=$?; rm -rf /tmp/$$; exit $ret" 0 1 2 3 15
mkdir /tmp/$$
TMP="/tmp/$$"