From nobody Tue Jun 14 17:52:23 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 45FC6844759; Tue, 14 Jun 2022 17:52:24 +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 4LMwxh16Wrz3kBc; Tue, 14 Jun 2022 17:52:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655229144; 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=9DG4jsAmn4O0QLwQHp4kRHpIIu9I9ilbn1BBqyW+LXs=; b=hmeDM534TgtZt9DZolLrH/u9+yuA3mGxgRBi3O32SYJvVaf8DfvWbt1/BGxHDBI4xBKWhY GtDvmglyYjpJlt9BGvysYx+ZS0QN5R2tnpMCpLoHpYf67Y6cg0DxSCbOYvMPf631z2pyKE 4xlDQsrnRh7o3UWMn0cPURlpj+5+GBbERVH3nXom8rDr3O23XiU3Dh8NKxc+C0dwzHLz/2 VC7Vw19hVgKynkxDBuMtzi+Z633/e0XD2Y74GoRV0KJlhWalyP4qcfrKdFpQVWWhDNMnoU 1qq7imizguRrwwHJY4V71yecppMglolvPwI7bHzaWQayXerds04K0IQrV+PETA== 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 EE4036E47; Tue, 14 Jun 2022 17:52:23 +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 25EHqN6R032893; Tue, 14 Jun 2022 17:52:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25EHqNE0032892; Tue, 14 Jun 2022 17:52:23 GMT (envelope-from git) Date: Tue, 14 Jun 2022 17:52:23 GMT Message-Id: <202206141752.25EHqNE0032892@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 6ab35c78fb5a - main - 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/main X-Git-Reftype: branch X-Git-Commit: 6ab35c78fb5af66d586d4846e2d81e020331ad3f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655229144; 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=9DG4jsAmn4O0QLwQHp4kRHpIIu9I9ilbn1BBqyW+LXs=; b=PLBX4eaLWpnOEUUknxQ4Vo66C3/YdKBn0KzJXW5jciBkV5761csMOUEZuCn+/V7hPS8I4i H7tVL7pM3ZhdPr1glCvckysoySbOAxlOYZyRG5uFr79dIGqS7EBgg9Fs/QHIPsitDXig4H cMZKyKDmueKvKIlcorv8Un2ESjwymEGTqOGXixjS1HQZkyQ1AQ8/PCuPXtNCfV5KXfpSAl rAF+9iBuapCHdboumxu/+ZYI/MNBG72sBlCNKpj3GSfiWLNfzXHihONnt1or6y9dJQspcK br/+hq79WuMIoP2MTN79hQyEW05HI/mltmz7r31yXMMieoeDKB/aO0EeVLRXDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655229144; a=rsa-sha256; cv=none; b=hlbpFvJk6PejXZnN98ORQPQ7eQvH8YL4bceEqjSGDeyl6dJPma6Xhyk6rRVT3Qqms5Mz8d G6sS2N4j2F5C22EApg8BULsrZBI92RKwUTzRWSVreT8Cwf9UcBL7gBPEbAsZ5QtdEeExLR Niuf5zCxywGi9SVf1f4dLMqAg5LRxOGOEfmugut1aGAGbLWOwKXPWC4CCee0ki34hqJqbR 7MmArRauzsUkUr4z8jjbK/0/GZV5IcqTrq5LP/DiXTIC4KiH8aio3d+tF40H5xJNasQaI1 lk10LHmRsegYRL4fG0S7hFWlKk30YLWLUy9K1UtH7lCbXMZ0DHGegyU1KtepEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6ab35c78fb5af66d586d4846e2d81e020331ad3f commit 6ab35c78fb5af66d586d4846e2d81e020331ad3f Author: John Baldwin AuthorDate: 2022-06-14 17:51:39 +0000 Commit: John Baldwin CommitDate: 2022-06-14 17:51:39 +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 --- 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 84c498580d4e..f3c437269026 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