xbps-src: perform chroot setup via binary-boostrap or bootstrap-update.

This will improve performance somewhat on buildbot because the bootstrap pkgs
will only be configured once, and not each time due to `xbps-src -t`.

Also remove redundant checks.
This commit is contained in:
Juan RP 2019-02-02 13:35:18 -02:00 committed by maxice8
parent 6d98eb908d
commit f35aa4cc19
No known key found for this signature in database
GPG key ID: 543B9D4F4299F06B

View file

@ -314,6 +314,8 @@ install_bbootstrap() {
msg_normal "Installed bootstrap successfully!\n" msg_normal "Installed bootstrap successfully!\n"
chroot_prepare $XBPS_TARGET_PKG || msg_error "Failed to initialize chroot!\n" chroot_prepare $XBPS_TARGET_PKG || msg_error "Failed to initialize chroot!\n"
chroot_check
chroot_handler clean
} }
reconfigure_bootstrap_pkgs() { reconfigure_bootstrap_pkgs() {
@ -555,9 +557,13 @@ if [ -n "${NO_COLOR+x}" ]; then
export NOCOLORS=1 export NOCOLORS=1
fi fi
if [ -f $XBPS_MASTERDIR/.xbps_chroot_init ]; then chroot_check() {
export CHROOT_READY=1 if [ -f $XBPS_MASTERDIR/.xbps_chroot_init ]; then
fi export CHROOT_READY=1
fi
}
chroot_check
if [ -z "$XBPS_REINIT" -a -s $XBPS_MASTERDIR/.xbps_chroot_init ]; then if [ -z "$XBPS_REINIT" -a -s $XBPS_MASTERDIR/.xbps_chroot_init ]; then
export XBPS_ARCH=${XBPS_ARCH:-$(cat $XBPS_MASTERDIR/.xbps_chroot_init)} export XBPS_ARCH=${XBPS_ARCH:-$(cat $XBPS_MASTERDIR/.xbps_chroot_init)}
@ -673,18 +679,14 @@ case "$XBPS_TARGET" in
install_bbootstrap bootstrap install_bbootstrap bootstrap
;; ;;
bootstrap-update) bootstrap-update)
bootstrap_update chroot_handler bootstrap-update
;; ;;
chroot) chroot)
chroot_handler chroot dummy chroot_handler chroot dummy
;; ;;
clean) clean)
if [ -z "$XBPS_TARGET_PKG" ]; then if [ -z "$XBPS_TARGET_PKG" ]; then
if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then chroot_handler remove-autodeps
chroot_handler remove-autodeps
else
remove_pkg_autodeps
fi
msg_normal "xbps-src: cleaning up masterdir...\n" msg_normal "xbps-src: cleaning up masterdir...\n"
chmod -R +wX $XBPS_MASTERDIR/builddir # Needed to remove Go Modules chmod -R +wX $XBPS_MASTERDIR/builddir # Needed to remove Go Modules
rm -rf $XBPS_MASTERDIR/builddir $XBPS_MASTERDIR/destdir rm -rf $XBPS_MASTERDIR/builddir $XBPS_MASTERDIR/destdir
@ -707,11 +709,7 @@ case "$XBPS_TARGET" in
consistency_check consistency_check
;; ;;
remove-autodeps) remove-autodeps)
if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then chroot_handler remove-autodeps
chroot_handler remove-autodeps
else
remove_pkg_autodeps
fi
;; ;;
fetch|extract|build|check|configure|install|pkg) fetch|extract|build|check|configure|install|pkg)
if [ "$XBPS_TARGET" = "check" ]; then if [ "$XBPS_TARGET" = "check" ]; then