Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Jan 2019 13:46:27 -0800
From:      Xin LI <delphij@gmail.com>
To:        Ed Maste <emaste@freebsd.org>
Cc:        "src-committers@freebsd.org" <src-committers@freebsd.org>,  "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,  "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r343122 - head/usr.sbin/freebsd-update
Message-ID:  <CAGMYy3uf9nDJQA%2B2SzapyhSTRV6tmXx1MPOpc9m67033HM8srA@mail.gmail.com>
In-Reply-To: <201901172138.x0HLcwBp082954@repo.freebsd.org>
References:  <201901172138.x0HLcwBp082954@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 17, 2019 at 1:39 PM Ed Maste <emaste@freebsd.org> wrote:

> Author: emaste
> Date: Thu Jan 17 21:38:57 2019
> New Revision: 343122
> URL: https://svnweb.freebsd.org/changeset/base/343122
>
> Log:
>   freebsd-update: Clarify unsupported release upgrade error message
>
>   Notify users that upgrading from -CURRENT or -STABLE is unsupported by
>   freebsd-update.
>
>   Also ensure --currently-running provides a correctly formatted release
>   (as done by -r).
>
>   PR:           234771
>   Submitted by: Gerald Aryeetey <aryeeteygerald_rogers.com>
>   Reported by:  yuri
>   Reviewed by:  bcran
>   MFC after:    1 month
>   Sponsored by: The FreeBSD Foundation
>   Differential Revision:        https://reviews.freebsd.org/D18803
>
> Modified:
>   head/usr.sbin/freebsd-update/freebsd-update.sh
>
> Modified: head/usr.sbin/freebsd-update/freebsd-update.sh
>
> ==============================================================================
> --- head/usr.sbin/freebsd-update/freebsd-update.sh      Thu Jan 17
> 20:01:06 2019        (r343121)
> +++ head/usr.sbin/freebsd-update/freebsd-update.sh      Thu Jan 17
> 21:38:57 2019        (r343122)
> @@ -304,6 +304,14 @@ config_TargetRelease () {
>         fi
>  }
>
> +# Pretend current release is FreeBSD $1
> +config_SourceRelease () {
> +       UNAME_r=$1
> +       if echo ${UNAME_r} | grep -qE '^[0-9.]+$'; then
> +               UNAME_r="${UNAME_r}-RELEASE"
> +       fi
> +}
> +
>  # Define what happens to output of utilities
>  config_VerboseLevel () {
>         if [ -z ${VERBOSELEVEL} ]; then
> @@ -442,7 +450,8 @@ parse_cmdline () {
>                         NOTTYOK=1
>                         ;;
>                 --currently-running)
> -                       shift; export UNAME_r="$1"
> +                       shift
> +                       config_SourceRelease $1 || usage
>                         ;;
>
>                 # Configuration file equivalents
> @@ -657,6 +666,18 @@ fetchupgrade_check_params () {
>         ARCH=`uname -m`
>         FETCHDIR=${RELNUM}/${ARCH}
>         PATCHDIR=${RELNUM}/${ARCH}/bp
> +
> +       # Disallow upgrade from a version that is not `-RELEASE`
> +       if ! echo "${RELNUM}" | grep -qE -- "-RELEASE$"; then
> +               echo -n "`basename $0`: "
> +               cat  <<- EOF
> +                       Cannot upgrade from a version that is not a
> '-RELEASE' using `basename $0`.
> +                       Instead, FreeBSD can be directly upgraded by
> source or upgraded to a
> +                       RELEASE/RELENG version prior to running `basename
> $0`.
> +               EOF
> +               echo "System version: ${RELNUM}"
> +               exit 1
> +       fi
>

I think this would break upgrading from e.g. -BETA or -RC, which is
supported?

Cheers,



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