From 4de0821a28d54153c6046655d4a2d8f57da7e005 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Tue, 25 Aug 2020 10:12:55 -0400 Subject: [PATCH] 16314: Fix cleanup of temp/arvbox dirs that contain readonly dirs. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- build/run-tests.sh | 5 ++++- tools/arvbox/bin/arvbox | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build/run-tests.sh b/build/run-tests.sh index 2742540b16..c926fe87a1 100755 --- a/build/run-tests.sh +++ b/build/run-tests.sh @@ -162,9 +162,12 @@ temp_preserve= clear_temp() { if [[ -z "$temp" ]]; then - # we didn't even get as far as making a temp dir + # we did not even get as far as making a temp dir : elif [[ -z "$temp_preserve" ]]; then + # Go creates readonly dirs in the module cache, which cause + # "rm -rf" to fail unless we chmod first. + chmod -R u+w "$temp" rm -rf "$temp" else echo "Leaving behind temp dirs in $temp" diff --git a/tools/arvbox/bin/arvbox b/tools/arvbox/bin/arvbox index 46acc8baf2..7d45ba17c1 100755 --- a/tools/arvbox/bin/arvbox +++ b/tools/arvbox/bin/arvbox @@ -497,6 +497,7 @@ case "$subcmd" in exit 1 fi set -x + chmod -R u+w "$ARVBOX_DATA" rm -rf "$ARVBOX_DATA" else if test "$1" != -f ; then -- 2.30.2