From 96b0edd68f77e041808c60c7100dd1ada392022d Mon Sep 17 00:00:00 2001 From: John Date: Mon, 21 Oct 2019 00:16:31 +0200 Subject: [PATCH 1/2] hooks/post-install: do remove lib32 symlink before checking for empty dirs this resulted in empty i686 packages never getting flagged as empty since the /usr/lib32 -> lib symlink was only removed after the check --- common/hooks/post-install/{98-lib32.sh => 00-lib32.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename common/hooks/post-install/{98-lib32.sh => 00-lib32.sh} (100%) diff --git a/common/hooks/post-install/98-lib32.sh b/common/hooks/post-install/00-lib32.sh similarity index 100% rename from common/hooks/post-install/98-lib32.sh rename to common/hooks/post-install/00-lib32.sh From 5e13391dc0e6626c4075ced12924414fd92e2038 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 21 Oct 2019 00:13:40 +0200 Subject: [PATCH 2/2] hooks/post-install/03-remove-empty-dirs.sh: use find -delete instead of rmdir -p rmdir -p could end up deleting even /destdir when a empty package would not have any subpackages with a i686 masterdir. --- common/hooks/post-install/03-remove-empty-dirs.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/common/hooks/post-install/03-remove-empty-dirs.sh b/common/hooks/post-install/03-remove-empty-dirs.sh index 4b7122938ab..c54f458f61e 100644 --- a/common/hooks/post-install/03-remove-empty-dirs.sh +++ b/common/hooks/post-install/03-remove-empty-dirs.sh @@ -2,13 +2,9 @@ hook() { if [ -d "${PKGDESTDIR}" ]; then - find "${PKGDESTDIR}" -type d -empty|sort -r|while read f; do + find "${PKGDESTDIR}" -mindepth 1 -type d -empty -print -delete|sort -r|while read f; do _dir="${f##${PKGDESTDIR}}" - [ -z "${_dir}" ] && continue - 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. - mkdir -p ${PKGDESTDIR} fi }