Github messages for voidlinux
 help / color / mirror / Atom feed
From: voidlinux-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: [PR PATCH] Fix empty dir check in i686 masterdirs.
Date: Mon, 21 Oct 2019 00:23:25 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-15654@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 872 bytes --]

There is a new pull request by Johnnynator against master on the void-packages repository

https://github.com/Johnnynator/void-packages lib32
https://github.com/void-linux/void-packages/pull/15654

Fix empty dir check in i686 masterdirs.
See e.g. https://travis-ci.org/void-linux/void-packages/builds/600443626?utm_source=github_status&utm_medium=notification , all of the builds should have failed, but i686 created a empty package even without the `meta` build_style. The issue was that the `lib32 -> lib` symlink still existed at the point of checking for empty dir, so `/usr` was in fact not empty, but is at `do_pkg`. Reordering the hooks fixes this but reveals another issue, namely that `rmdir -p` will remove even `/destdir` and would therefore break actual meta packages.

A patch file from https://github.com/void-linux/void-packages/pull/15654.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-lib32-15654.patch --]
[-- Type: text/x-diff, Size: 2082 bytes --]

From 96b0edd68f77e041808c60c7100dd1ada392022d Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
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 <johnz@posteo.net>
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
 }

             reply	other threads:[~2019-10-20 22:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-20 22:23 voidlinux-github [this message]
2019-10-22 14:58 ` [PR PATCH] [Merged]: " voidlinux-github

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-15654@inbox.vuxu.org \
    --to=voidlinux-github@inbox.vuxu.org \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).