From 341ea2572427bb7739f0ab6d38ea269890d287bd Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 21 Mar 2018 12:15:06 +0100 Subject: [PATCH] all.sh: be more conservative when cleaning up CMake artefacts Only delete things that we expect to find, to avoid deleting other things that people might have lying around in their build tree. Explicitly skip .git to avoid e.g. accidentally matching a branch name. --- tests/scripts/all.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 9728bd52a..96b33a15e 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -133,7 +133,13 @@ cleanup() { command make clean - find . -name yotta -prune -o -iname '*cmake*' -not -name CMakeLists.txt -exec rm -rf {} \+ + # Remove CMake artefacts + find . -name .git -prune -o -name yotta -prune -o \ + -iname CMakeFiles -exec rm -rf {} \+ -o \ + \( -iname cmake_install.cmake -o \ + -iname CTestTestfile.cmake -o \ + -iname CMakeCache.txt \) -exec rm {} \+ + # Recover files overwritten by in-tree CMake builds rm -f include/Makefile include/mbedtls/Makefile programs/*/Makefile git update-index --no-skip-worktree Makefile library/Makefile programs/Makefile tests/Makefile git checkout -- Makefile library/Makefile programs/Makefile tests/Makefile