Date: Mon, 6 Feb 2012 03:30:10 GMT From: Alvin Poon <aspoon@gmail.com> To: freebsd-ports-bugs@FreeBSD.org Subject: Re: ports/151521: pkg_upgrade (sysutils/bsdadminscripts) not working if /usr/ports not present Message-ID: <201202060330.q163UAWO048505@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/151521; it has been noted by GNATS. From: Alvin Poon <aspoon@gmail.com> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202060330.q163UAWO048505>