diff --git a/xbps-src b/xbps-src index cacb4de0c6..a79de519a4 100755 --- a/xbps-src +++ b/xbps-src @@ -314,6 +314,8 @@ install_bbootstrap() { msg_normal "Installed bootstrap successfully!\n" chroot_prepare $XBPS_TARGET_PKG || msg_error "Failed to initialize chroot!\n" + chroot_check + chroot_handler clean } reconfigure_bootstrap_pkgs() { @@ -555,9 +557,13 @@ if [ -n "${NO_COLOR+x}" ]; then export NOCOLORS=1 fi -if [ -f $XBPS_MASTERDIR/.xbps_chroot_init ]; then - export CHROOT_READY=1 -fi +chroot_check() { + if [ -f $XBPS_MASTERDIR/.xbps_chroot_init ]; then + export CHROOT_READY=1 + fi +} + +chroot_check if [ -z "$XBPS_REINIT" -a -s $XBPS_MASTERDIR/.xbps_chroot_init ]; then export XBPS_ARCH=${XBPS_ARCH:-$(cat $XBPS_MASTERDIR/.xbps_chroot_init)} @@ -673,18 +679,14 @@ case "$XBPS_TARGET" in install_bbootstrap bootstrap ;; bootstrap-update) - bootstrap_update + chroot_handler bootstrap-update ;; chroot) chroot_handler chroot dummy ;; clean) if [ -z "$XBPS_TARGET_PKG" ]; then - if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then - chroot_handler remove-autodeps - else - remove_pkg_autodeps - fi + chroot_handler remove-autodeps 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 @@ -707,11 +709,7 @@ case "$XBPS_TARGET" in consistency_check ;; remove-autodeps) - if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then - chroot_handler remove-autodeps - else - remove_pkg_autodeps - fi + chroot_handler remove-autodeps ;; fetch|extract|build|check|configure|install|pkg) if [ "$XBPS_TARGET" = "check" ]; then