Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2016-03-21 11:49:16 +1000
committerAllan McRae <allan@archlinux.org>2016-03-21 13:14:56 +1000
commitbaf1ff64e6ea23e93f307480480d87159cd2e487 (patch)
tree8ac96f4674e206eb4a1e600b07670f1c5a21cbb0 /scripts
parent02731189f1ced6050238e4af7e76a54d4ac6f3bd (diff)
libmakepkg: ensure emptydir find command acts on individual directories
Using "-exec command {} +" systax exits on any error. Such errors occur when running rmdir on a non-empty directory. Switch to "{} ;" syntax instead which avoids exiting before the find command is completed. Fixes FS#48515. Note, we can not use "-empty" in the find command because it is not supported by Busybox find, and the "--ignore-fail-on-non-empty" flag for rmdir is not available on BSD rmdir variants. Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/libmakepkg/tidy/emptydirs.sh.in3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/libmakepkg/tidy/emptydirs.sh.in b/scripts/libmakepkg/tidy/emptydirs.sh.in
index 32b8d8ca..85ab39df 100644
--- a/scripts/libmakepkg/tidy/emptydirs.sh.in
+++ b/scripts/libmakepkg/tidy/emptydirs.sh.in
@@ -33,6 +33,7 @@ tidy_remove+=('tidy_emptydirs')
tidy_emptydirs() {
if check_option "emptydirs" "n"; then
msg2 "$(gettext "Removing empty directories...")"
- find . -depth -type d -exec rmdir '{}' + 2>/dev/null
+ # we are unable to use '-empty' as it is non-POSIX and not support by all find variants
+ find . -depth -type d -exec rmdir '{}' \; 2>/dev/null
fi
}