diff --git a/xbps-src b/xbps-src index a79de519a40..2b8e99e1ef6 100755 --- a/xbps-src +++ b/xbps-src @@ -686,7 +686,11 @@ case "$XBPS_TARGET" in ;; clean) if [ -z "$XBPS_TARGET_PKG" ]; then - chroot_handler remove-autodeps + if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then + chroot_handler remove-autodeps + else + remove_pkg_autodeps + fi msg_normal "xbps-src: cleaning up masterdir...\n" chmod -R +wX $XBPS_MASTERDIR/builddir # Needed to remove Go Modules rm -rf $XBPS_MASTERDIR/builddir $XBPS_MASTERDIR/destdir @@ -709,7 +713,11 @@ case "$XBPS_TARGET" in consistency_check ;; remove-autodeps) - chroot_handler remove-autodeps + if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then + chroot_handler remove-autodeps + else + remove_pkg_autodeps + fi ;; fetch|extract|build|check|configure|install|pkg) if [ "$XBPS_TARGET" = "check" ]; then