Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Mar 2014 22:15:34 -0800
From:      Royce Williams <royce@tycho.org>
To:        Colin Percival <cperciva@freebsd.org>
Cc:        Randy Bush <randy@psg.com>, Alfred Perlstein <alfred@freebsd.org>, FreeBSD Mailing List <freebsd-ports@freebsd.org>
Subject:   Re: reason 23 why we've moved to linux
Message-ID:  <CA%2BE3k918C%2Bjg23YKEwOk82pqAaF7GSdk2uvF6P_uSxu1MstWzA@mail.gmail.com>
In-Reply-To: <m2y502qda9.wl%randy@psg.com>
References:  <m2iorb1ms8.wl%randy@psg.com> <53287821.4040209@freebsd.org> <m2ha6v1m4z.wl%randy@psg.com> <5328A03A.3000305@freebsd.org> <m261n6rtkf.wl%randy@psg.com> <532DD2EB.1080204@freebsd.org> <m238iart92.wl%randy@psg.com> <532DD64B.9000905@freebsd.org> <m2zjkiqds8.wl%randy@psg.com> <532DD978.3010502@freebsd.org> <m2y502qda9.wl%randy@psg.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BE3k918C%2Bjg23YKEwOk82pqAaF7GSdk2uvF6P_uSxu1MstWzA>