public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoo-functions:master commit in: functions/
Date: Fri,  2 Aug 2024 23:14:12 +0000 (UTC)	[thread overview]
Message-ID: <1722468970.d6e689bc832e4b033f4af9cb6746a99649ecc8d8.sam@gentoo> (raw)

commit:     d6e689bc832e4b033f4af9cb6746a99649ecc8d8
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Wed Jul 31 23:20:10 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jul 31 23:36:10 2024 +0000
URL:        https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=d6e689bc

Treat EINFO_LOG as false if equal to RC_SERVICE

Consider the value of EINFO_LOG to be false in the event that it is
equal to the value of RC_SERVICE. The reason for this is that, as of the
time of writing, openrc-run(8) defines and uses EINFO_LOG in a way that
is at odds with gentoo-functions. Ideally, the behaviour of OpenRC would
be modified so that it becomes possible to jettison this workaround.

Fixes: 0dd8364c03c6f8737150ee4f146ddeeec57efee9
Bug: https://bugs.gentoo.org/936613
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>

 functions/rc.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/functions/rc.sh b/functions/rc.sh
index 9129b32..9b1fc5d 100644
--- a/functions/rc.sh
+++ b/functions/rc.sh
@@ -117,7 +117,11 @@ eoutdent()
 #
 # Invokes the logger(1) utility, provided that EINFO_LOG is true. The first
 # parameter shall be taken as a priority level, the second as the message tag,
-# and the remaining parameters as the message to be logged.
+# and the remaining parameters as the message to be logged. As a special case,
+# the value of EINFO_LOG shall be treated as if were false in the event that it
+# is equal to the value of RC_SERVICE. The reason for this is that, as of the
+# time of writing, openrc-run(8) defines and uses EINFO_LOG in a way that is
+# at odds with gentoo-functions.
 #
 esyslog()
 {
@@ -126,7 +130,7 @@ esyslog()
 	if [ "$#" -lt 2 ]; then
 		warn "esyslog: too few arguments (got $#, expected at least 2)"
 		return 1
-	elif yesno "${EINFO_LOG}" && hash logger 2>/dev/null; then
+	elif [ "${EINFO_LOG}" != "${RC_SERVICE}" ] && yesno "${EINFO_LOG}"; then
 		pri=$1 tag=$2
 		shift 2
 		msg=$*


             reply	other threads:[~2024-08-02 23:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-02 23:14 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-08-05  2:02 [gentoo-commits] proj/gentoo-functions:master commit in: functions/ Sam James
2024-07-07  5:55 Sam James
2024-07-07  5:55 Sam James
2024-07-07  5:55 Sam James
2024-06-25  4:06 Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1722468970.d6e689bc832e4b033f4af9cb6746a99649ecc8d8.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox