From 5f6c5e19b32b3bf015b845d19e44a0a4156ddf0f Mon Sep 17 00:00:00 2001 From: Piraty 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() {