From 5b066f3564ba8f3f52b1e8f56d3edb552097272e Mon Sep 17 00:00:00 2001 From: jbu Date: Mon, 27 Apr 2015 10:22:18 +0200 Subject: [PATCH] xbps-src: fix handling of path names containing spaces --- common/hooks/post-install/03-remove-empty-dirs.sh | 3 ++- 1 file changed, 2 insertions(+), 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 4e73f6b34fc..0d8b74bba38 100644 --- a/common/hooks/post-install/03-remove-empty-dirs.sh +++ b/common/hooks/post-install/03-remove-empty-dirs.sh @@ -1,7 +1,8 @@ # This hooks removes empty dirs and warns about them. hook() { - for f in $(find ${PKGDESTDIR} -type d -empty|sort -r); do + for f in $(find ${PKGDESTDIR} -type d -empty|sort -r|tr " " "|"); do + f="${f//|/ }" _dir="${f##${PKGDESTDIR}}" [ -z "${_dir}" ] && continue rmdir --ignore-fail-on-non-empty -p "$f" &>/dev/null