diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-07-09 20:58:03 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-07-09 21:16:57 -0400 |
commit | 0b8606e0cd0e1aedfe222d4d6603c4986aacb7b5 (patch) | |
tree | 07947cf2483913abf45ab1791ce18d23c6c72a39 /src | |
parent | bec81703da55dbcd8ed30f424317d2970a5f11c1 (diff) |
librerelease: Fix rmdir failingv20170709.1
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.
Diffstat (limited to 'src')
-rwxr-xr-x | src/abslibre-tools/librerelease | 11 |
1 files 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 -- '{}' + +) ################################################################################ |