From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5404815800F for ; Mon, 13 Feb 2023 21:37:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5084AE07A9; Mon, 13 Feb 2023 21:37:27 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 23B3DE07A9 for ; Mon, 13 Feb 2023 21:37:27 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3C69A340B9C for ; Mon, 13 Feb 2023 21:37:26 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7DD438AD for ; Mon, 13 Feb 2023 21:37:24 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1676324140.747923957049eb32c2a7b6aa5e52c12e6dcc561e.sam@gentoo> Subject: [gentoo-commits] proj/gentoo-functions:master commit in: / X-VCS-Repository: proj/gentoo-functions X-VCS-Files: functions.sh X-VCS-Directories: / X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 747923957049eb32c2a7b6aa5e52c12e6dcc561e X-VCS-Branch: master Date: Mon, 13 Feb 2023 21:37:24 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 263f76cc-fb4d-479b-a3c3-a675b93322d4 X-Archives-Hash: 25d1d12a9580fac394fdfc6feb8f1db6 commit: 747923957049eb32c2a7b6aa5e52c12e6dcc561e Author: Kerin Millar plushkava net> AuthorDate: Mon Feb 13 03:52:24 2023 +0000 Commit: Sam James gentoo org> CommitDate: Mon Feb 13 21:35:40 2023 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=74792395 Guard against errexit in the v-prefixed functions This also improves the structure of some of them, slightly. Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> functions.sh | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/functions.sh b/functions.sh index 2361808..3c782cd 100644 --- a/functions.sh +++ b/functions.sh @@ -294,52 +294,71 @@ ewend() } # v-e-commands honor EINFO_VERBOSE which defaults to no. -# The condition is negated so the return value will be zero. veinfo() { - yesno "${EINFO_VERBOSE}" && einfo "$@" + if yesno "${EINFO_VERBOSE}"; then + einfo "$@" + fi } veinfon() { - yesno "${EINFO_VERBOSE}" && einfon "$@" + if yesno "${EINFO_VERBOSE}"; then + einfon "$@" + fi } vewarn() { - yesno "${EINFO_VERBOSE}" && ewarn "$@" + if yesno "${EINFO_VERBOSE}"; then + ewarn "$@" + fi } veerror() { - yesno "${EINFO_VERBOSE}" && eerror "$@" + if yesno "${EINFO_VERBOSE}"; then + eerror "$@" + fi } vebegin() { - yesno "${EINFO_VERBOSE}" && ebegin "$@" + if yesno "${EINFO_VERBOSE}"; then + ebegin "$@" + fi } veend() { - yesno "${EINFO_VERBOSE}" && { eend "$@"; return $?; } - return "${1:-0}" + if yesno "${EINFO_VERBOSE}"; then + eend "$@" + else + return "${1:-0}" + fi } vewend() { - yesno "${EINFO_VERBOSE}" && { ewend "$@"; return $?; } - return "${1:-0}" + if yesno "${EINFO_VERBOSE}"; then + ewend "$@" + else + return "${1:-0}" + fi } veindent() { - yesno "${EINFO_VERBOSE}" && eindent + if yesno "${EINFO_VERBOSE}"; then + eindent + fi } veoutdent() { - yesno "${EINFO_VERBOSE}" && eoutdent + if yesno "${EINFO_VERBOSE}"; then + eoutdent + fi } #