* [PR PATCH] xbps-src: (zap) correctly empty the masterdir
@ 2019-10-13 18:41 voidlinux-github
2019-10-13 18:53 ` voidlinux-github
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: voidlinux-github @ 2019-10-13 18:41 UTC (permalink / raw)
To: ml
[-- 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() {
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: xbps-src: (zap) correctly empty the masterdir
2019-10-13 18:41 [PR PATCH] xbps-src: (zap) correctly empty the masterdir voidlinux-github
@ 2019-10-13 18:53 ` voidlinux-github
2019-10-14 8:11 ` voidlinux-github
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: voidlinux-github @ 2019-10-13 18:53 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 369 bytes --]
New comment by pullmoll on void-packages repository
https://github.com/void-linux/void-packages/pull/15437#issuecomment-541446675
Comment:
I hope we don't have a situation where some host directory is (bind) mounted at `$XBPS_MASTERDIR` or below, or otherwise you'll zap the host's tree there as well. Perhaps add `umount -Rrf $XBPS_MASTERDIR` to be a little safer?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: xbps-src: (zap) correctly empty the masterdir
2019-10-13 18:41 [PR PATCH] xbps-src: (zap) correctly empty the masterdir voidlinux-github
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
3 siblings, 0 replies; 5+ messages in thread
From: voidlinux-github @ 2019-10-14 8:11 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 444 bytes --]
New comment by pullmoll on void-packages repository
https://github.com/void-linux/void-packages/pull/15437#issuecomment-541446675
Comment:
I hope we don't have a situation where some host directory is (bind) mounted at `$XBPS_MASTERDIR` or below, or otherwise you'll zap the host's tree there as well. Perhaps add `umount -Rrf $XBPS_MASTERDIR` to be a little safer?
Edit: Never mind. When zap is called there are no active mounts AFAICS.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: xbps-src: (zap) correctly empty the masterdir
2019-10-13 18:41 [PR PATCH] xbps-src: (zap) correctly empty the masterdir voidlinux-github
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
3 siblings, 0 replies; 5+ messages in thread
From: voidlinux-github @ 2019-10-21 16:02 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 184 bytes --]
New comment by xtraeme on void-packages repository
https://github.com/void-linux/void-packages/pull/15437#issuecomment-544583971
Comment:
you could still run `zap` after `chroot`...
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PR PATCH] [Merged]: xbps-src: (zap) correctly empty the masterdir
2019-10-13 18:41 [PR PATCH] xbps-src: (zap) correctly empty the masterdir voidlinux-github
` (2 preceding siblings ...)
2019-10-21 16:02 ` voidlinux-github
@ 2019-10-21 16:55 ` voidlinux-github
3 siblings, 0 replies; 5+ messages in thread
From: voidlinux-github @ 2019-10-21 16:55 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 400 bytes --]
There's a merged pull request on the void-packages repository
xbps-src: (zap) correctly empty the masterdir
https://github.com/void-linux/void-packages/pull/15437
Description:
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-10-21 16:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-13 18:41 [PR PATCH] xbps-src: (zap) correctly empty the masterdir voidlinux-github
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
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).