reason 23 why we've moved to linux

Royce Williams royce at tycho.org
Tue Mar 25 06:15:57 UTC 2014


Colin, adding you to this thread with proposed patch (two options) for
freebsd-update, below.

On Sat, Mar 22, 2014 at 10:49 AM, Randy Bush <randy at psg.com> wrote:
>> Honest question, have you been building things from source under
>> debian's ports or are you using their version of "pkg"?
>
> the latter
>
> and i have two 9 systems where i try to use freebsd-update.  also a
> time-consuming rabbit hole leading nowhere pleasant.  e.g.
>
> # freebsd-update upgrade -r 9.2-RELEASE-p3
> Looking up update.FreeBSD.org mirrors... 5 mirrors found.
> Fetching metadata signature for 9.2-RELEASE from update5.freebsd.org... done.
> Fetching metadata index... done.
> Inspecting system... done.
>
> The following components of FreeBSD seem to be installed:
> kernel/generic world/base world/doc world/games world/lib32
>
> The following components of FreeBSD do not seem to be installed:
>
> Does this look reasonable (y/n)? y
>
> Fetching metadata signature for 9.2-RELEASE-p3 from update5.freebsd.org... failed.
> Fetching metadata signature for 9.2-RELEASE-p3 from update2.freebsd.org... failed.
> Fetching metadata signature for 9.2-RELEASE-p3 from update3.freebsd.org... failed.
> Fetching metadata signature for 9.2-RELEASE-p3 from update4.freebsd.org... failed.
> Fetching metadata signature for 9.2-RELEASE-p3 from update6.freebsd.org... failed.
> No mirrors remaining, giving up.

Randy, you're not the first to specify a patch level in the target
release version for freebsd-update.  This failure mode could be more
friendly.

One of the patches below (or something like them) could help.

We could either warn the user, and stop:

--- freebsd-update.bak  2013-11-29 07:18:36.000000000 -0900
+++ freebsd-update      2014-03-24 21:59:20.000000000 -0800
@@ -674,6 +674,15 @@
                exit 1
        fi

+       # The target release should not specify a patch level.
+       if echo "${TARGETRELEASE}" | grep -qE "\-p[0-9]+$"; then
+               TARGETRELEASE=`echo ${TARGETRELEASE} |
+                   sed -E 's,-p[0-9]+,,'`
+               echo -n "`basename $0`: "
+               echo "Cannot upgrade to a specific patch level - try
'-r ${TARGETRELEASE}' instead"
+               exit 1
+       fi
+
        # Turning off AllowAdd or AllowDelete is a bad idea for upgrades.
        if [ "${ALLOWADD}" = "no" ]; then
                echo -n "`basename $0`: "


... or else freebsd-update could DWIM by precisely stripping any patch
level, and continuing:

--- freebsd-update.bak  2013-11-29 07:18:36.000000000 -0900
+++ freebsd-update.new  2014-03-24 22:09:37.000000000 -0800
@@ -674,6 +674,16 @@
                exit 1
        fi

+       # The target release should not specify a patch level.
+       if echo "${TARGETRELEASE}" | grep -qE "\-p[0-9]+$"; then
+               TARGETRELEASE=`echo ${TARGETRELEASE} |
+                   sed -E 's,-p[0-9]+,,'`
+               echo -n "`basename $0`: "
+               echo -n "WARNING: Cannot upgrade to a specific patch level. "
+               echo "Using ${TARGETRELEASE} instead."
+               echo
+       fi
+
        # Turning off AllowAdd or AllowDelete is a bad idea for upgrades.
        if [ "${ALLOWADD}" = "no" ]; then
                echo -n "`basename $0`: "


Colin, tweak (or take a different tack) as you see fit, of course.

Royce


More information about the freebsd-ports mailing list