xbps-src: added support for PREFER_BINPKG_DEPS with xbps >= 0.9.0.

This commit is contained in:
Juan RP 2011-06-24 22:00:47 +02:00
parent 8271950e94
commit 517f1cfd06
2 changed files with 22 additions and 7 deletions

View File

@ -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()

View File

@ -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"
}