From: Matthias Schmidt Date: Wed, 19 Aug 2009 17:12:57 +0000 (+0200) Subject: pkg_search: Change URLs and honor possible mirror settings X-Git-Tag: v2.4.0~178 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/0bc904b6e96f6d63ed3db2c5b1473c8170845f70 pkg_search: Change URLs and honor possible mirror settings - Change the version variable to match latest changes on avalon (2.2 -> 2.2.0) - If the user uses $BINPKG_SITES or /etc/settings.conf (like with pkg_radd) try to download the summary file from a mirror first. If that fails, fall back to default aka avalon NOTE: If someone changes the directory layout on avalon, please update the pkg_* tools in base as well. --- diff --git a/usr.bin/pkg_search/pkg_search.sh b/usr.bin/pkg_search/pkg_search.sh index 305df9b6eb..a065938d8e 100644 --- a/usr.bin/pkg_search/pkg_search.sh +++ b/usr.bin/pkg_search/pkg_search.sh @@ -34,12 +34,16 @@ # $DragonFly: src/usr.bin/pkg_search/pkg_search.sh,v 1.11 2008/09/04 10:33:50 matthias Exp $ UNAME=`uname -s` -VERSION=`uname -r | cut -d '.' -f 1,2` +VERSION=`uname -r | awk -F - '{ print $1; }'` NO_INDEX=0 PORTSDIR=/usr/pkgsrc PKGSUM=${PORTSDIR}/pkg_summary -PKGSRCBOX1=http://avalon.dragonflybsd.org/packages/${UNAME}-${VERSION}/stable/ -PKGSRCBOX2=http://avalon.dragonflybsd.org/packages/DragonFly-2.2/stable/ +if [ -z "$BINPKG_SITES" ]; then + BINPKG_SITES=http://avalon.dragonflybsd.org/packages/${UNAME}-${VERSION}/stable/ + [ -f /etc/settings.conf ] && . /etc/settings.conf +fi +PKGSRCBOX1=$BINPKG_SITES +PKGSRCBOX2=http://avalon.dragonflybsd.org/packages/DragonFly-2.2.0/stable/ INDEXFILE=INDEX # Download the pkg_summary file