svn commit: r343122 - head/usr.sbin/freebsd-update
Xin LI
delphij at gmail.com
Thu Jan 17 21:46:40 UTC 2019
On Thu, Jan 17, 2019 at 1:39 PM Ed Maste <emaste at 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,
More information about the svn-src-all
mailing list