diff --git a/xbps-src b/xbps-src index 0a09cba0ba..486a8c77b1 100755 --- a/xbps-src +++ b/xbps-src @@ -289,19 +289,29 @@ install_bbootstrap() { msg_error "Failed to install bootstrap packages!\n" fi # Reconfigure base-files to create dirs/symlinks. - if xbps-query -r $XBPS_MASTERDIR base-directories &>/dev/null; then - XBPS_ARCH=$XBPS_TARGET_PKG xbps-reconfigure -r $XBPS_MASTERDIR -f base-directories &>/dev/null - else + if xbps-query -r $XBPS_MASTERDIR base-files &>/dev/null; then XBPS_ARCH=$XBPS_TARGET_PKG xbps-reconfigure -r $XBPS_MASTERDIR -f base-files &>/dev/null fi - # Reconfigure ca-certificates. - if xbps-query -r $XBPS_MASTERDIR ca-certificates &>/dev/null; then - XBPS_ARCH=$XBPS_TARGET_PKG xbps-reconfigure -r $XBPS_MASTERDIR -f ca-certificates &>/dev/null - fi + msg_normal "Installed bootstrap successfully!\n" chroot_prepare $XBPS_TARGET_PKG || msg_error "Failed to initialize chroot!\n" } +reconfigure_bootstrap_pkgs() { + local statefile="$XBPS_MASTERDIR/.xbps_chroot_configured" + local pkgs="ca-certificates" + [ -z "$IN_CHROOT" -o -e $statefile ] && return 0 + # Reconfigure ca-certificates. + msg_normal "Reconfiguring bootstrap packages...\n" + for f in ${pkgs}; do + if xbps-query $f &>/dev/null; then + xbps-reconfigure -f $f + fi + done + touch -f $statefile +} + + bootstrap_update() { if [ -z "$CHROOT_READY" ]; then return @@ -317,7 +327,7 @@ bootstrap_update() { masterdir_zap() { for f in bin boot builddir destdir dev etc home lib lib32 lib64 mnt \ opt proc root run sbin sys tmp usr var host media xbps \ - void-packages .xbps_chroot_init; do + void-packages .xbps_chroot_init .xbps_chroot_reconfigured; do if [ -d "$XBPS_MASTERDIR/$f" ]; then echo "Removing directory $XBPS_MASTERDIR/$f ..." rm -rf $XBPS_MASTERDIR/$f @@ -606,6 +616,8 @@ if [ -z "$IN_CHROOT" ]; then fi fi +reconfigure_bootstrap_pkgs + # # Main switch. #