mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-22 07:48:50 -05:00
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>
This commit is contained in:
parent
02731189f1
commit
baf1ff64e6
@ -33,6 +33,7 @@ tidy_remove+=('tidy_emptydirs')
|
|||||||
tidy_emptydirs() {
|
tidy_emptydirs() {
|
||||||
if check_option "emptydirs" "n"; then
|
if check_option "emptydirs" "n"; then
|
||||||
msg2 "$(gettext "Removing empty directories...")"
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user