From nobody Wed Jul 13 16:47:43 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5927117FCB16; Wed, 13 Jul 2022 16:47:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ljk7g1gj5z3WRB; Wed, 13 Jul 2022 16:47:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657730863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t5oWyErb1+O25CQ5D3hPPNjtW9KyY7jkiW388t+hWh8=; b=Z6RzKO6wMKtPJQXMPJsqcujif95ykbqeXTyyyTFdkiQ2bKOuCEja9dhs6X95/LWJBi5+Zt 2zRIO9j8EQCiCD2O1hsaMrb3LDTsEewAQQVQxqrHhIX01Cbi7KMFWaj74iAgkd+qSwvAFO OIJkU8L5sWZVLUTT7ztswfOwt1R0UbcvKCh2kpsWKtW7/f6TuH9xSPAOEDswqfCU/0+UAc b+8Xtk3yVhcR+ql0WTR79cFjU54gx4G7xOhjtazkKPItS9vclorOxShTRYqVrndiwAhR7G gfPp066gvkSbcgdfn0RmE7RgTxzlZlV0N/4W+5JlQ3O/9Gu7JmqCBUdBP3NjnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ljk7g0nBbzW6P; Wed, 13 Jul 2022 16:47:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26DGlhaZ052305; Wed, 13 Jul 2022 16:47:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26DGlhUs052304; Wed, 13 Jul 2022 16:47:43 GMT (envelope-from git) Date: Wed, 13 Jul 2022 16:47:43 GMT Message-Id: <202207131647.26DGlhUs052304@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 74a790b760a9 - stable/13 - newvers.sh: Don't use return to exit. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 74a790b760a90ed125e1732fc02ab8b3eff9cb75 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657730863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t5oWyErb1+O25CQ5D3hPPNjtW9KyY7jkiW388t+hWh8=; b=Fhipfo8txVNrZeyBmIcBbSEmWnBuKsFgkAY6HB5FiAWzhKz4+Qa8Tvxnbp+uukq5dUchHe fiRkNRF8HR5WGS0svqKUF+J13uGGEbtdL8WMujnN29AuptM1s5u3aNZNcWzERWzTXzEa5U B8MBA1wa8b3/LD7MICIc26BSGDg+ltkf2B+Mg1BsLRq05HVgZYLJnX9P5CuGWJha04pana dalrfXV2EVe7fO2SmpRDrkqduxLYpgHYfI9nCQ/7w0Ifb9HLPSATjHKWdlcfWp8uhOHjqq f9w3fowMNf4jDGUUEW2Zm1pFjw26+iYQ7hW43Z0l3LsDbSCn75QLtDP3Kvg88A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657730863; a=rsa-sha256; cv=none; b=qqLuc/FCCmlIik2m964yZijrLufD2+POUCOoOi2U7EyrwmI40eBFQ5mPsPcTRgrDu7l/qo Hn4/OCZavCu/rfc5O13fLByd7Z51BKgb8B8BU/psbZxU/aqHloOOwfOnzezgVry9Ap0vuX tVztt6pNublRiW9eRJrRHtKoGTM14JSeU4AYsLd+i0PFM/doF2/ZdfJFL8BPltzJCxN7BU 0y+6AXW+WbXPktUL+rIK4+/7vwmwiNQ+VTWIuP5xw5mwRieuJY+uyMmznwngh27I4knF2w W9Y5LhMy3sdwkZOsNQlj0A0e5Izd1C28v4Mozij7yae6U6GPL0B9+HrIUvZ1GQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=74a790b760a90ed125e1732fc02ab8b3eff9cb75 commit 74a790b760a90ed125e1732fc02ab8b3eff9cb75 Author: John Baldwin AuthorDate: 2022-06-14 17:51:39 +0000 Commit: John Baldwin CommitDate: 2022-07-13 16:20:34 +0000 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 0dfb0a455e55..48320ce1b7c3 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -127,7 +127,7 @@ while getopts crRvV: opt; do v=$OPTARG eval val=\$${v} echo ${v}=\"${val}\" - VARS_ONLY=1 + VARS_ONLY_EXIT=1 ;; esac done @@ -137,6 +137,10 @@ shift $((OPTIND - 1)) # included. [ -n "$VARS_ONLY" ] && return 0 +# VARS_ONLY_EXIT means no files should be generated, only the value of +# variables are being output. +[ -n "$VARS_ONLY_EXIT" ] && exit 0 + # # findvcs dir # Looks up directory dir at world root and up the filesystem