Github messages for voidlinux
 help / color / mirror / Atom feed
From: voidlinux-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: [PR PATCH] xbps-src: (zap) correctly empty the masterdir
Date: Sun, 13 Oct 2019 20:41:40 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-15437@inbox.vuxu.org> (raw)

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

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

https://github.com/Piraty/void-packages xbps-src-zap
https://github.com/void-linux/void-packages/pull/15437

xbps-src: (zap) correctly empty the masterdir
Instead of relying on a potentially outdated list of files and dirs to
remove, just remove+recreate the whole masterdir.

This previously led to leftover .xbps* files, which broke subsequent
operations.

See: #14476

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xbps-src-zap-15437.patch --]
[-- Type: text/x-diff, Size: 1530 bytes --]

From 5f6c5e19b32b3bf015b845d19e44a0a4156ddf0f Mon Sep 17 00:00:00 2001
From: Piraty <piraty1@inbox.ru>
Date: Sun, 13 Oct 2019 20:27:54 +0200
Subject: [PATCH] xbps-src: (zap) correctly empty the masterdir

Instead of relying on a potentially outdated list of files and dirs to
remove, just remove+recreate the whole masterdir.

This previously led to leftover .xbps* files, which broke subsequent
operations

Fixes #14476
---
 xbps-src | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/xbps-src b/xbps-src
index 1a43dd5cf21..f7ff84c191f 100755
--- a/xbps-src
+++ b/xbps-src
@@ -329,21 +329,9 @@ bootstrap_update() {
 }
 
 masterdir_zap() {
-    for f in bin boot builddir destdir dev etc home lib lib32 lib64 mnt \
-        opt proc root run sbin sys tmp usr var host media xbps \
-        void-packages .xbps_chroot_init .xbps_chroot_configured; do
-        if [ -d "$XBPS_MASTERDIR/$f" ]; then
-            echo "Removing directory $XBPS_MASTERDIR/$f ..."
-            rm -rf $XBPS_MASTERDIR/$f
-        elif [ -h "$XBPS_MASTERDIR/$f" ]; then
-            echo "Removing link $XBPS_MASTERDIR/$f ..."
-            rm -f $XBPS_MASTERDIR/$f
-        elif [ -f "$XBPS_MASTERDIR/$f" ]; then
-            echo "Removing file $XBPS_MASTERDIR/$f ..."
-            rm -f $XBPS_MASTERDIR/$f
-        fi
-    done
-    echo "$XBPS_MASTERDIR masterdir cleaned up."
+    rm -rf "$XBPS_MASTERDIR"
+    mkdir -p "$XBPS_MASTERDIR"
+    msg_normal "$XBPS_MASTERDIR masterdir cleaned up."
 }
 
 exit_func() {

             reply	other threads:[~2019-10-13 18:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-13 18:41 voidlinux-github [this message]
2019-10-13 18:53 ` voidlinux-github
2019-10-14  8:11 ` voidlinux-github
2019-10-21 16:02 ` voidlinux-github
2019-10-21 16:55 ` [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-15437@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).