From owner-svn-src-user@FreeBSD.ORG Mon Nov 9 08:48:02 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 489C5106566C; Mon, 9 Nov 2009 08:48:02 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 386D08FC0A; Mon, 9 Nov 2009 08:48:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nA98m27E013820; Mon, 9 Nov 2009 08:48:02 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA98m2BB013818; Mon, 9 Nov 2009 08:48:02 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200911090848.nA98m2BB013818@svn.freebsd.org> From: Doug Barton Date: Mon, 9 Nov 2009 08:48:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199071 - user/dougb/portmaster X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 08:48:02 -0000 Author: dougb Date: Mon Nov 9 08:48:01 2009 New Revision: 199071 URL: http://svn.freebsd.org/changeset/base/199071 Log: 1. Be more robust in choosing the string to search for: a. If there is a '.' in PKGNAME use ${PKGNAME%%\.*} to handle ports like lang/tcl* whose LATEST_LINK is different. This also saves an external call to make in the common case b. If there is no '.', then use LATEST_LINK. 2. Change the grep for finding the latest package version to pick from the anchor tag just like the truncation code in the previous commit Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Mon Nov 9 08:34:44 2009 (r199070) +++ user/dougb/portmaster/portmaster Mon Nov 9 08:48:01 2009 (r199071) @@ -2293,9 +2293,13 @@ if [ -n "$PM_PACKAGES" ]; then #echo '' [ -n "$PM_VERBOSE" ] && echo "===>>> Checking package repository" - latest_link=`pm_make -V LATEST_LINK` - latest_pv=`fetch -q -o - ${sitepath} 2>/dev/null | grep ">$latest_link"` - unset latest_link + + case "$new_port" in + *\.*) s=${new_port%%\.*} ;; + *) s=`pm_make -V LATEST_LINK` ;; + esac + latest_pv=`fetch -q -o - ${sitepath} 2>/dev/null | grep "href=\"${s}"` + unset s if [ -z "$latest_pv" ]; then echo "===>>> Package and/or archive not found at:"