diff --git a/xbps-src/shutils/chroot.sh.in b/xbps-src/shutils/chroot.sh.in index c5f620d847..6f209f9bcd 100644 --- a/xbps-src/shutils/chroot.sh.in +++ b/xbps-src/shutils/chroot.sh.in @@ -185,16 +185,26 @@ prepare_binpkg_repos() { local repo xver - # Check for xbps utils >= 0.9.0. + # Copy xbps-conf.plist for XBPS utils >= 0.9.0. xver=$($XBPS_PKGDB_CMD -V|awk '{print $2}') - for repo in ${XBPS_REPO_LIST}; do - if [ -z "$xver" -o "$xver" = "" ]; then + if [ -n "$xver" ]; then + for f in /etc /usr/local/etc; do + if [ -f $f/xbps-conf.plist ]; then + cp -f $f/xbps-conf.plist \ + ${XBPS_MASTERDIR}/usr/local/etc + fi + done + # XBPS utils >= 0.9.0. + msg_normal "Synchronizing index for remote repositories...\n" + ${chroot_cmd} ${XBPS_MASTERDIR} ${XBPS_REPO_CMD} sync + else + for repo in ${XBPS_REPO_LIST}; do ${chroot_cmd} ${XBPS_MASTERDIR} ${XBPS_REPO_CMD} \ add ${repo} 2>/dev/null [ $? -ne 0 ] && \ msg_warn "Failed to sync pkg-index from ${repo}\n" - fi - done + done + fi } create_busybox_links() diff --git a/xbps-src/shutils/init_funcs.sh.in b/xbps-src/shutils/init_funcs.sh.in index 9391529eb3..bab29c5eaa 100644 --- a/xbps-src/shutils/init_funcs.sh.in +++ b/xbps-src/shutils/init_funcs.sh.in @@ -61,10 +61,15 @@ set_defvars() [ ! -d "$val" ] && mkdir -p $val done + xver=$(xbps-bin.static -V|awk '{print $2}') + if [ -n "$xver" ]; then + # XBPS utils >= 0.9.0. + xbps_conf="-C $XBPS_MASTERDIR/usr/local/etc/xbps-conf.plist" + fi export XBPS_PKGDB_CMD="xbps-uhelper.static -r $XBPS_MASTERDIR" - export XBPS_BIN_CMD="xbps-bin.static -r $XBPS_MASTERDIR" + export XBPS_BIN_CMD="xbps-bin.static $xbps_conf -r $XBPS_MASTERDIR" + export XBPS_REPO_CMD="xbps-repo.static $xbps_conf -r $XBPS_MASTERDIR" export XBPS_DIGEST_CMD="xbps-uhelper.static digest" export XBPS_CMPVER_CMD="xbps-uhelper.static cmpver" export XBPS_FETCH_CMD="xbps-uhelper.static fetch" - export XBPS_REPO_CMD="xbps-repo.static" }