From owner-svn-src-head@FreeBSD.ORG Thu Nov 7 21:38:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 41586A41; Thu, 7 Nov 2013 21:38:47 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2C7CA2FC7; Thu, 7 Nov 2013 21:38:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA7LclOe067370; Thu, 7 Nov 2013 21:38:47 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA7Lck2Z067365; Thu, 7 Nov 2013 21:38:46 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311072138.rA7Lck2Z067365@svn.freebsd.org> From: Devin Teske Date: Thu, 7 Nov 2013 21:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257819 - in head/usr.sbin/bsdconfig/share: . media X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2013 21:38:47 -0000 Author: dteske Date: Thu Nov 7 21:38:46 2013 New Revision: 257819 URL: http://svnweb.freebsd.org/changeset/base/257819 Log: 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. Modified: head/usr.sbin/bsdconfig/share/common.subr head/usr.sbin/bsdconfig/share/media/http.subr Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Thu Nov 7 21:20:34 2013 (r257818) +++ head/usr.sbin/bsdconfig/share/common.subr Thu Nov 7 21:38:46 2013 (r257819) @@ -62,12 +62,10 @@ export UNAME_S="$(uname -s)" # Operating 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 # Modified: head/usr.sbin/bsdconfig/share/media/http.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/http.subr Thu Nov 7 21:20:34 2013 (r257818) +++ head/usr.sbin/bsdconfig/share/media/http.subr Thu Nov 7 21:38:46 2013 (r257819) @@ -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