xbps-src: adapt for xbps-0.10.0.

This commit is contained in:
Juan RP 2011-10-21 11:00:32 +02:00
parent 6b21e43ac4
commit 2299ca2aea
2 changed files with 27 additions and 8 deletions

View File

@ -200,9 +200,20 @@ prepare_binpkg_repos()
{
local repo xver CONF_FILE
# Copy xbps-conf.plist for XBPS utils >= 0.9.0.
xver=$($XBPS_PKGDB_CMD -V|awk '{print $2}')
if [ -n "$xver" ]; then
case "$xver" in
0.1[0-9].[0-9]*)
mkdir -p ${XBPS_MASTERDIR}/usr/local/etc/xbps
for f in /etc /usr/local/etc; do
if [ -d $f/xbps ]; then
cp -f $f/xbps/*.plist \
${XBPS_MASTERDIR}/usr/local/etc/xbps
fi
done
msg_normal "Synchronizing index for remote repositories...\n"
${XBPS_REPO_CMD} sync
;;
0.[89].[0-9]*)
CONF_FILE=$XBPS_MASTERDIR/usr/local/etc/xbps-conf.plist
for f in /etc /usr/local/etc; do
if [ -f $f/xbps-conf.plist -a \
@ -214,13 +225,15 @@ prepare_binpkg_repos()
# XBPS utils >= 0.9.0.
msg_normal "Synchronizing index for remote repositories...\n"
${XBPS_REPO_CMD} sync
else
;;
*)
for repo in ${XBPS_REPO_LIST}; do
${XBPS_REPO_CMD} add ${repo} 2>/dev/null
[ $? -ne 0 ] && \
msg_warn "Failed to sync pkg-index from ${repo}\n"
done
fi
;;
esac
}
create_busybox_links()

View File

@ -70,11 +70,17 @@ set_defvars()
done
xver=$(xbps-bin.static -V|awk '{print $2}')
if [ -n "$xver" ]; then
# XBPS utils >= 0.9.0.
case "${xver}" in
0.1[0-9].[0-9]*)
xbps_conf="-C $XBPS_MASTERDIR/usr/local/etc/xbps"
;;
0.[89].[0-9]*)
# XBPS < 0.10.0
xbps_conf="-C $XBPS_MASTERDIR/usr/local/etc/xbps-conf.plist"
xbps_conf="$xbps_conf -c $XBPS_MASTERDIR/host/repocache"
fi
;;
esac
xbps_conf="$xbps_conf -c $XBPS_MASTERDIR/host/repocache"
export XBPS_PKGDB_CMD="xbps-uhelper.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"