]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
newvers.sh: Don't use return to exit.
authorJohn Baldwin <jhb@FreeBSD.org>
Tue, 14 Jun 2022 17:51:39 +0000 (10:51 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Wed, 13 Jul 2022 16:20:34 +0000 (09:20 -0700)
commit74a790b760a90ed125e1732fc02ab8b3eff9cb75
treefaf4124b5c5b2d7443943917f271df23b2a447c3
parentb45594b2713a38490fde1029f16b2f338a2ef77b
newvers.sh: Don't use return to exit.

Commit acfb506b3d00 replaced an exit 0 when using -V with a return
instead.  FreeBSD's sh treats a return outside of a function like
exit, but this is a non-portable extension.  Other Bourne shells only
permit return to be used within a function and continue execution
(possibly with a warning).

To fix, don't reuse VARS_ONLY (which is intended to be set by other
scripts before sourcing newvers.sh directly) and instead use a new
variable (VARS_ONLY_EXIT) to restore the use of exit for the
non-sourced case.

Reviewed by: emaste
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D35481

(cherry picked from commit 6ab35c78fb5af66d586d4846e2d81e020331ad3f)
sys/conf/newvers.sh