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 69B0C15849D for ; Wed, 22 May 2024 01:12:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 21B33E2A35; Wed, 22 May 2024 01:12:28 +0000 (UTC) Received: from smtp.gentoo.org (dev.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 00B33E2A35 for ; Wed, 22 May 2024 01:12: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)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4779A33BEBB for ; Wed, 22 May 2024 01:12:27 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2EFEC1B05 for ; Wed, 22 May 2024 01:12: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: <1716197300.5c82cfc08a05e994dbb719040a8ed6c81f6b6ec6.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: 5c82cfc08a05e994dbb719040a8ed6c81f6b6ec6 X-VCS-Branch: master Date: Wed, 22 May 2024 01:12: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: 0b570bea-9833-4496-bc5f-31a3bce54f84 X-Archives-Hash: 0a05be5c9cff130effaaa0bf9c4ab150 commit: 5c82cfc08a05e994dbb719040a8ed6c81f6b6ec6 Author: Kerin Millar plushkava net> AuthorDate: Mon May 20 07:45:22 2024 +0000 Commit: Sam James gentoo org> CommitDate: Mon May 20 09:28:20 2024 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=5c82cfc0 Adhere to the Allman style (again) For sh, not awk. Signed-off-by: Kerin Millar plushkava.net> functions.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/functions.sh b/functions.sh index c82c229..8c0d1c1 100644 --- a/functions.sh +++ b/functions.sh @@ -92,7 +92,8 @@ ebegin() # Should the command fail, a diagnostic message shall be printed and the shell # be made to exit by calling the die function. # -edo() { +edo() +{ genfun_cmd=$(_print_args "$@") einfo "Executing: ${genfun_cmd}" "$@" || die "Failed to execute command: ${genfun_cmd}" @@ -117,7 +118,8 @@ eend() # for _ in eerror einfo ewarn; do eval " - $_ () { + $_ () + { ${_}n \"\${*}\${genfun_newline}\" } " @@ -183,7 +185,8 @@ eoutdent() # parameters the value of a "files" key. The resulting object shall be rendered # as JSON by jq(1) before being logged by the logger(1) utility. # -eqatag() { +eqatag() +{ local arg argc json positional tag case ${genfun_has_jq} in @@ -249,7 +252,8 @@ eqatag() { # the message shall also be conveyed to the esyslog function. For now, this is # implemented merely as an ewarn wrapper. # -eqawarn() { +eqawarn() +{ ewarn "$@" } @@ -409,7 +413,8 @@ is_older_than() # for _ in vebegin veerror veindent veinfo veinfon veoutdent vewarn; do eval " - $_ () { + $_ () + { if yesno \"\${EINFO_VERBOSE}\"; then ${_#v} \"\$@\" fi @@ -605,7 +610,8 @@ _is_visible() # of the ${*@Q} expansion in bash. The output shall be POSIX sh compatible as of # Issue 8. This should probably be made to exist as a standalone awk script. # -_print_args() { +_print_args() +{ awk -v q=\' -f - -- "$@" <<-'EOF' BEGIN { argc = ARGC