From ecdb3900afa0665f7542e8a25498702a9fe6ae42 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 23 May 2014 17:14:00 +0200 Subject: [PATCH] xbps-src: clean target without args removes autodeps/{build,dest}dir now. --- xbps-src | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/xbps-src b/xbps-src index 1ccca6abebe..7a3418d3462 100755 --- a/xbps-src +++ b/xbps-src @@ -26,8 +26,10 @@ build chroot Enter to the chroot in . -clean - Remove build directory. +clean [pkgname] + Removes auto dependencies, cleans up /builddir and /destdir. + If argument is specified only the builddir for that package will be + cleaned up. configure Configure a package (fetch + extract + configure). @@ -558,13 +560,19 @@ case "$XBPS_TARGET" in chroot_handler chroot dummy ;; clean) - read_pkg - if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then - chroot_handler $XBPS_TARGET $XBPS_TARGET_PKG || exit $? + if [ -z "$XBPS_TARGET_PKG" ]; then + chroot_handler remove-autodeps + msg_normal "xbps-src: cleaning up masterdir...\n" + rm -rf $XBPS_MASTERDIR/builddir/* $XBPS_MASTERDIR/destdir/* else - remove_pkg_wrksrc $wrksrc - if declare -f do_clean >/dev/null; then - run_func do_clean + read_pkg + if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then + chroot_handler $XBPS_TARGET $XBPS_TARGET_PKG || exit $? + else + remove_pkg_wrksrc $wrksrc + if declare -f do_clean >/dev/null; then + run_func do_clean + fi fi fi ;;