From 3a665efea1b34b20df50bbc2c130c06ac75e1961 Mon Sep 17 00:00:00 2001 From: jbu Date: Sat, 25 Apr 2015 13:26:18 +0200 Subject: [PATCH 1/2] xbps-src: Fix read loop for empty dirs; closes #1409 --- common/hooks/post-install/03-remove-empty-dirs.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/hooks/post-install/03-remove-empty-dirs.sh b/common/hooks/post-install/03-remove-empty-dirs.sh index 4e73f6b34fc..b2cb91b5727 100644 --- a/common/hooks/post-install/03-remove-empty-dirs.sh +++ b/common/hooks/post-install/03-remove-empty-dirs.sh @@ -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. From ffefcc41a5ffe9d1077217baaf94ed199834e6b9 Mon Sep 17 00:00:00 2001 From: jbu Date: Sat, 25 Apr 2015 13:30:01 +0200 Subject: [PATCH 2/2] xbps-src: Don't print rmdir output --- common/hooks/post-install/03-remove-empty-dirs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/hooks/post-install/03-remove-empty-dirs.sh b/common/hooks/post-install/03-remove-empty-dirs.sh index b2cb91b5727..00f198d52a2 100644 --- a/common/hooks/post-install/03-remove-empty-dirs.sh +++ b/common/hooks/post-install/03-remove-empty-dirs.sh @@ -4,7 +4,7 @@ hook() { 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.