summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-02-24 12:58:24 (GMT)
committerBaserock Gerrit <gerrit@baserock.org>2016-02-25 17:55:09 (GMT)
commit6c3fd14e110efbffab165a4100ea38e8fd17222b (patch)
treeb2586a7ed2af75263bbaddd3139379ca98bbbddf
parent962992ddba2f3540f1507ee1c902b02f87c08c6a (diff)
downloaddefinitions-6c3fd14e110efbffab165a4100ea38e8fd17222b.tar.gz
mason: Use 'find' to clean the cache
Previous approach is not working anymore: # mv /srv/distbuild/!(remove) /srv/distbuild/remove -sh: syntax error: unexpected "(" Also use `find -delete` instead of `rm -r` because is faster. Change-Id: I0b500869281ce44ce565b8cca051c91961a6613d
-rwxr-xr-xextensions/mason/mason-report.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/extensions/mason/mason-report.sh b/extensions/mason/mason-report.sh
index 4368a89..f6cca0e 100755
--- a/extensions/mason/mason-report.sh
+++ b/extensions/mason/mason-report.sh
@@ -293,5 +293,5 @@ mv "$logfile" "$SERVER_PATH/$BUILD_LOG"
# Cleanup
mkdir -p /srv/distbuild/remove
-mv /srv/distbuild/!(remove) /srv/distbuild/remove
-rm -r /srv/distbuild/remove
+find /srv/distbuild/ -not \( -name "remove" -o -name "trees.cache.pickle" \) -mindepth 1 -maxdepth 1 -exec mv '{}' /srv/distbuild/remove \;
+find /srv/distbuild/remove -delete