Do not remove $systest on out-of-tree builds

Previously, $systest directory was removed for out-of-tree builds. For
directories with compiled content (binaries), this breaks subsequent
make invocations:

    make: Target 'check' not remade because of errors.
    Making all in dyndb/driver
    /bin/bash: line 20: cd: dyndb/driver: No such file or directory
    Making all in dlzexternal/driver
    /bin/bash: line 20: cd: dlzexternal/driver: No such file or directory

Current approach removes only files known to Git and empty directories
in $systest (including $systest).
parent f90211f5
Pipeline #47987 canceled with stages
in 57 minutes and 4 seconds
......@@ -294,21 +294,27 @@ elif [ "$sanitizer_summaries" -ne 0 ]; then
echoinfo "I:$systest:$sanitizer_summaries sanitizer report(s) found"
fi
print_outstanding_files() {
if test -d ${srcdir}/../../../.git; then
git status -su --ignored "${systest}" 2>/dev/null | \
sed -n -e 's|^?? \(.*\)|\1|p' \
-e 's|^!! \(.*/named.run\)$|\1|p' \
-e 's|^!! \(.*/named.memstats\)$|\1|p'
fi
}
if [ $status -ne 0 ]; then
echofail "R:$systest:FAIL"
else
echopass "R:$systest:PASS"
if $clean; then
( cd "${systest}" && $SHELL clean.sh "$@" )
if [ "${srcdir}" != "${builddir}" ]; then
rm -rf "./${systest}" ## FIXME (this also removes compiled binaries)
fi
if test -d ${srcdir}/../../../.git; then
git status -su --ignored "${systest}" 2>/dev/null | \
sed -n -e 's|^?? \(.*\)|I:file \1 not removed|p' \
-e 's|^!! \(.*/named.run\)$|I:file \1 not removed|p' \
-e 's|^!! \(.*/named.memstats\)$|I:file \1 not removed|p'
fi
( cd "${systest}" && $SHELL clean.sh "$@" )
if [ "${srcdir}" = "${builddir}" ]; then
print_outstanding_files
else
print_outstanding_files | xargs rm -rf
find "./${systest}" \( -type d -empty -o -name Makefile.in \) -delete 2>/dev/null
fi
fi
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment