From 5f030fe2f1cb4e79e021c472643837fcd9a7f92e Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 2 Nov 2015 20:25:16 +0100 Subject: [PATCH] xbps-src: force reconfiguration of bootstrap pkgs on chroot setup. Right now ca-certificates internally requires the `openssl` utility to generate /etc/ssl/certs. Certainly we need to perform this task only once and iff we are within the chroot, because the host might not have it in PATH. This should fix the travis issue seen since xbps-0.48 was released. --- xbps-src | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/xbps-src b/xbps-src index 0a09cba0ba6..486a8c77b18 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. #