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 C43BF15806E for ; Wed, 7 Jun 2023 11:13:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E34AFE0872; Wed, 7 Jun 2023 11:13:38 +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) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C6D67E0872 for ; Wed, 7 Jun 2023 11:13:38 +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 04830335D80 for ; Wed, 7 Jun 2023 11:13:38 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 43EEBA7A for ; Wed, 7 Jun 2023 11:13:36 +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: <1686136338.f8260d8494ac1fc243f9543a6b6836e69d7054d0.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: f8260d8494ac1fc243f9543a6b6836e69d7054d0 X-VCS-Branch: master Date: Wed, 7 Jun 2023 11:13:36 +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: 3c5b61ab-35f0-406c-bd14-911713219d85 X-Archives-Hash: ed066496474d0d543d96400f1e29551c commit: f8260d8494ac1fc243f9543a6b6836e69d7054d0 Author: Kerin Millar plushkava net> AuthorDate: Fri Feb 24 02:24:23 2023 +0000 Commit: Sam James gentoo org> CommitDate: Wed Jun 7 11:12:18 2023 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=f8260d84 Use ewarn() to print the recently added diagnostic messages Both the _eprint() and _eend() functions will be overhauled in the near future, at which point conveying diagnostic messages (indirectly) to _eprint() will become beneficial. This commit affects the following functions. - esyslog - is_older_than - veend - vewend Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> functions.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/functions.sh b/functions.sh index 53f3205..31d1b43 100644 --- a/functions.sh +++ b/functions.sh @@ -95,7 +95,7 @@ esyslog() local pri tag msg if [ "$#" -lt 2 ]; then - printf 'Too few arguments for esyslog (got %d, expected at least 2)\n' "$#" >&2 + ewarn "Too few arguments for esyslog (got $#, expected at least 2)" return 1 elif [ -n "${EINFO_LOG}" ] && hash logger 2>/dev/null; then pri=$1 @@ -208,7 +208,7 @@ _eend() if [ "$#" -eq 0 ]; then retval=0 elif ! is_int "$1" || [ "$1" -lt 0 ]; then - printf 'Invalid argument given to %s (the exit status code must be an integer >= 0)\n' "${CALLER}" >&2 + ewarn "Invalid argument given to ${CALLER} (the exit status code must be an integer >= 0)" retval=0 shift else @@ -331,7 +331,7 @@ veend() if yesno "${EINFO_VERBOSE}"; then CALLER=veend eend "$@" elif [ "$#" -gt 0 ] && { ! is_int "$1" || [ "$1" -lt 0 ]; }; then - printf 'Invalid argument given to veend (the exit status code must be an integer >= 0)\n' >&2 + ewarn "Invalid argument given to veend (the exit status code must be an integer >= 0)" else return "$1" fi @@ -342,7 +342,7 @@ vewend() if yesno "${EINFO_VERBOSE}"; then CALLER=vewend ewend "$@" elif [ "$#" -gt 0 ] && { ! is_int "$1" || [ "$1" -lt 0 ]; }; then - printf 'Invalid argument given to vewend (the exit status code must be an integer >= 0)\n' >&2 + ewarn "Invalid argument given to vewend (the exit status code must be an integer >= 0)" else return "$1" fi @@ -408,7 +408,7 @@ is_older_than() local ref has_gfind if [ "$#" -lt 2 ]; then - printf 'Too few arguments for is_older_than (got %d, expected at least 2)\n' "$#" >&2 + ewarn "Too few arguments for is_older_than (got $#, expected at least 2)" return 1 elif [ -e "$1" ]; then ref=$1