diff options
author | cperciva <cperciva@FreeBSD.org> | 2010-09-10 20:20:28 +0000 |
---|---|---|
committer | cperciva <cperciva@FreeBSD.org> | 2010-09-10 20:20:28 +0000 |
commit | 2dd00a962482f132c1730ef7bf7dfc7a39629a6b (patch) | |
tree | b3326df356eacb08acb404a329eb54981530aa07 | |
parent | 27d52dcc5a2dcf6dd0587244b2106a5eeca545a1 (diff) | |
download | FreeBSD-src-2dd00a962482f132c1730ef7bf7dfc7a39629a6b.zip FreeBSD-src-2dd00a962482f132c1730ef7bf7dfc7a39629a6b.tar.gz |
"freebsd-update fetch -r NEWRELEASE" is meaningless and probably a typo
for "freebsd-update upgrade -r NEWRELEASE". Error out and suggest what
the user probably meant.
Submitted by: James Seward
MFC after: 1 month
-rw-r--r-- | usr.sbin/freebsd-update/freebsd-update.sh | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 0539eb3..b542077 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -572,7 +572,7 @@ fetch_setup_verboselevel () { # running *-p[0-9]+, strip off the last part; if the # user is running -SECURITY, call it -RELEASE. Chdir # into the working directory. -fetch_check_params () { +fetchupgrade_check_params () { export HTTP_USER_AGENT="freebsd-update (${COMMAND}, `uname -r`)" _SERVERNAME_z=\ @@ -655,9 +655,21 @@ fetch_check_params () { BDHASH=`echo ${BASEDIR} | sha256 -q` } +# Perform sanity checks etc. before fetching updates. +fetch_check_params () { + fetchupgrade_check_params + + if ! [ -z "${TARGETRELEASE}" ]; then + echo -n "`basename $0`: " + echo -n "-r option is meaningless with 'fetch' command. " + echo "(Did you mean 'upgrade' instead?)" + exit 1 + fi +} + # Perform sanity checks etc. before fetching upgrades. upgrade_check_params () { - fetch_check_params + fetchupgrade_check_params # Unless set otherwise, we're upgrading to the same kernel config. NKERNCONF=${KERNCONF} |