Use `pkg -vv' to obtain ABI for validating a chosen media server (done

prior to diving head-long into a pkg-update(8), et. al). This should
also be more future-proof than what was being done just before this.
This commit is contained in:
Devin Teske 2013-11-07 21:38:46 +00:00
parent 0e9dcedc67
commit 29b5dbe844
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=257819
2 changed files with 6 additions and 9 deletions

View File

@ -62,12 +62,10 @@ export UNAME_S="$(uname -s)" # Operating System (i.e. FreeBSD)
export UNAME_P="$(uname -p)" # Processor Architecture (i.e. i386)
export UNAME_M="$(uname -m)" # Machine platform (i.e. i386)
export UNAME_R="$(uname -r)" # Release Level (i.e. X.Y-RELEASE)
if [ ! "$UNAME_PKG" ]; then
case "$UNAME_M:$UNAME_P" in
i386:i386) UNAME_PKG="x86:32" ;;
amd64:amd64) UNAME_PKG="x86:64" ;;
*) UNAME_PKG="$UNAME_M:$UNAME_P"
esac
if [ ! "${PKG_ABI+set}" ]; then
export PKG_ABI="$(
pkg -vv | awk '$1=="ABI:"{print $2;exit}' 2> /dev/null
)"
fi
#

View File

@ -499,9 +499,8 @@ f_media_init_http()
#
local fdir hp
f_getvar $VAR_HTTP_PATH%/ hp
setvar $VAR_HTTP_PATH \
"$hp/freebsd:${UNAME_R%%.*}:$UNAME_PKG/latest"
if f_http_check_access; then
setvar $VAR_HTTP_PATH "$hp/$PKG_ABI/latest"
if [ "$PKG_ABI" ] && f_http_check_access; then
http_found=$SUCCESS
else
for fdir in $HTTP_DIRS; do