From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Feb 6 03:30:11 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AF431065674 for ; Mon, 6 Feb 2012 03:30:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2B65F8FC18 for ; Mon, 6 Feb 2012 03:30:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q163UAKu048506 for ; Mon, 6 Feb 2012 03:30:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q163UAWO048505; Mon, 6 Feb 2012 03:30:10 GMT (envelope-from gnats) Date: Mon, 6 Feb 2012 03:30:10 GMT Message-Id: <201202060330.q163UAWO048505@freefall.freebsd.org> To: freebsd-ports-bugs@FreeBSD.org From: Alvin Poon Cc: Subject: Re: ports/151521: pkg_upgrade (sysutils/bsdadminscripts) not working if /usr/ports not present X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Alvin Poon List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 03:30:11 -0000 The following reply was made to PR ports/151521; it has been noted by GNATS. From: Alvin Poon To: bug-followup@FreeBSD.org, subs@christiantena.net Cc: Subject: Re: ports/151521: pkg_upgrade (sysutils/bsdadminscripts) not working if /usr/ports not present Date: Mon, 6 Feb 2012 11:01:29 +0800 The problem resurfaces as 9-RELEASE is available: # pkg_upgrade -aC fetch: ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-release/INDEX: File unavailable (e.g., file not found, no access) # It appears to be a problem with the name "packages-9-release", as the folder available on FTP is actually "packages-9.0-release". (note the .0 in the version) Once the system switches to stable releases such as "packages-9-stable" it should work fine. (as packages-9-stable is available on FTP) The problem is found in /usr/local/sbin/uma, line 76 onwards: 71 # Logic from src/usr.sbin/pkg_install/add/main.c, plus the possibility to 72 # override the architecture with ARCH. 73 : ${PACKAGEROOT="ftp://ftp.freebsd.org"} 74 : ${ARCH="$(uname -m)"} 75 branch="$(uname -r | tr '[:upper:]' '[:lower:]')" 76 number="${branch%%.*}" 77 branch="${branch##*-}" 78 case "$branch" in 79 release) 80 branch=$number-$branch 81 ;; 82 stable|current) 83 branch=${number%%.*}-$branch 84 ;; 85 *) 86 # Fallback to stable for prerelease and the like. 87 branch=${number%%.*}-stable 88 ;; 89 esac It arbitrarily removed the .x minor version from the number. It should have been "number=${branch%%-*}", since the minor version is further stripped off in the following case statements depending on the release.