xbps-src: Fix read loop for empty dirs; closes #1409

This commit is contained in:
jbu 2015-04-25 13:26:18 +02:00
parent 786d25b579
commit 3a665efea1
1 changed files with 2 additions and 2 deletions

View File

@ -1,10 +1,10 @@
# This hooks removes empty dirs and warns about them.
hook() {
for f in $(find ${PKGDESTDIR} -type d -empty|sort -r); do
find ${PKGDESTDIR} -type d -empty -print0|sort -z -r|while IFS="" read f; do
_dir="${f##${PKGDESTDIR}}"
[ -z "${_dir}" ] && continue
rmdir --ignore-fail-on-non-empty -p "$f" &>/dev/null
rmdir --ignore-fail-on-non-empty -p "$f" # &>/dev/null
msg_warn "$pkgver: removed empty dir: ${_dir}\n"
done
# Create PKGDESTDIR in case it has been removed previously.