xbps-src: correctly cleanup masterdir/tmp in the 'clean' target

465e481b70 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.
This commit is contained in:
Piraty 2020-02-25 18:08:59 +01:00 committed by Piraty
parent 0d76f817de
commit 6f328a3532
1 changed files with 5 additions and 3 deletions

View File

@ -734,9 +734,11 @@ case "$XBPS_TARGET" in
fi fi
msg_normal "xbps-src: cleaning up masterdir...\n" msg_normal "xbps-src: cleaning up masterdir...\n"
# Needed to remove Go Modules # Needed to remove Go Modules
[ -d $XBPS_MASTERDIR/builddir ] && chmod -R +wX $XBPS_MASTERDIR/builddir [ -d "$XBPS_BUILDDIR" ] && chmod -R +wX $XBPS_BUILDDIR
rm -rf $XBPS_MASTERDIR/builddir $XBPS_MASTERDIR/destdir rm -rf \
rm -f $XBPS_MASTERDIR/tmp/* >/dev/null 2>&1 $XBPS_BUILDDIR \
$XBPS_DESTDIR \
$XBPS_MASTERDIR/tmp/* $XBPS_MASTERDIR/tmp/.*
else else
read_pkg read_pkg
if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then