From 0b8606e0cd0e1aedfe222d4d6603c4986aacb7b5 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 9 Jul 2017 20:58:03 -0400 Subject: librerelease: Fix rmdir failing This changed because I added `set -e`. There's no test for this (yet) because it would take too long for me to mock the server-size. I'll do it eventually. Also, this fixes HOOKPOSTRELEASE running in $WORKDIR/staging, which is the wrong place for it to run. --- src/abslibre-tools/librerelease | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease index 2da919f..de3cc24 100755 --- a/src/abslibre-tools/librerelease +++ b/src/abslibre-tools/librerelease @@ -106,7 +106,7 @@ sign_packages() { } # Clean everything if not in dry-run mode -clean_files() { +clean_files() ( local file_list=$1 local rmcmd=(rm -fv) @@ -115,10 +115,11 @@ clean_files() { fi msg "Removing files from local staging directory" - cd "${WORKDIR}/staging" && xargs -0r -a "$file_list" "${rmcmd[@]}" - cd "${WORKDIR}/staging" && find . -mindepth 1 -type d -empty \ - -exec rmdir -p {} + 2>/dev/null -} + cd "${WORKDIR}/staging" + xargs -0r -a "$file_list" "${rmcmd[@]}" + find . -depth -mindepth 1 -type d \ + -exec rmdir --ignore-fail-on-non-empty -- '{}' + +) ################################################################################ -- cgit v1.2.3-54-g00ecf