From 6f328a35326dd0012f715270f8cc9d2379d2f580 Mon Sep 17 00:00:00 2001 From: Piraty Date: Tue, 25 Feb 2020 18:08:59 +0100 Subject: [PATCH] xbps-src: correctly cleanup masterdir/tmp in the 'clean' target 465e481b70a forgot `rm -r` when cleaning /tmp. As a result, `xbps-src clean` returned 1 when directories are present in /tmp because the last `rm` returned with an (suppressed) error. Also use the global variables for builddir and destdir, to be more consistent. --- xbps-src | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xbps-src b/xbps-src index 5c37441792..cbe4c73b90 100755 --- a/xbps-src +++ b/xbps-src @@ -734,9 +734,11 @@ case "$XBPS_TARGET" in fi msg_normal "xbps-src: cleaning up masterdir...\n" # Needed to remove Go Modules - [ -d $XBPS_MASTERDIR/builddir ] && chmod -R +wX $XBPS_MASTERDIR/builddir - rm -rf $XBPS_MASTERDIR/builddir $XBPS_MASTERDIR/destdir - rm -f $XBPS_MASTERDIR/tmp/* >/dev/null 2>&1 + [ -d "$XBPS_BUILDDIR" ] && chmod -R +wX $XBPS_BUILDDIR + rm -rf \ + $XBPS_BUILDDIR \ + $XBPS_DESTDIR \ + $XBPS_MASTERDIR/tmp/* $XBPS_MASTERDIR/tmp/.* else read_pkg if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then