blob: cfc5bf927198ae6e69b82d70a419efec47d66be1 [file] [log] [blame]
From: Brian Norris <briannorris@chromium.org>
Date: Tue, 5 Dec 2023 15:19:50 -0800
Subject: [PATCH] qmerge: Send ewarn, etc., to stderr
The PMS specifically calls out that ewarn should not display its message
to stdout. Portage sends all e{log,info,warn,...} to stderr. Imitate
that.
This discrepancy causes problems for ghc-package.eclass users, for one,
as there are instances where that class purposely dumps a warning and
then expects its callers to still use its stdout as a result.
Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
Ported from upstream commit 23d47fe0ead50e4a98eb4b1a02f68d350f53a166
qmerge.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/qmerge.c
+++ b/qmerge.c
@@ -794,8 +794,8 @@ pkg_run_func_at(
"has() { hasq \"$@\"; }\n"
"hasq() { local h=$1; shift; case \" $* \" in *\" $h \"*) return 0;; *) return 1;; esac; }\n"
"hasv() { hasq \"$@\" && echo \"$1\"; }\n"
- "elog() { printf ' * %%b\\n' \"$*\"; }\n"
- "einfon() { printf ' * %%b' \"$*\"; }\n"
+ "elog() { printf ' * %%b\\n' \"$*\" >&2; }\n"
+ "einfon() { printf ' * %%b' \"$*\" >&2; }\n"
"einfo() { elog \"$@\"; }\n"
"ewarn() { elog \"$@\"; }\n"
"eqawarn() { elog \"QA: \"\"$@\"; }\n"
@@ -805,8 +805,8 @@ pkg_run_func_at(
"fperms() { local f a=$1; shift; for f in \"$@\"; do chmod $a \"${ED}/${f}\"; done; }\n"
/* TODO: This should suppress `die` */
"nonfatal() { \"$@\"; }\n"
- "ebegin() { printf ' * %%b ...' \"$*\"; }\n"
- "eend() { local r=${1:-$?}; [ $# -gt 0 ] && shift; [ $r -eq 0 ] && echo ' [ ok ]' || echo \" $* \"'[ !! ]'; return $r; }\n"
+ "ebegin() { printf ' * %%b ...' \"$*\" >&2; }\n"
+ "eend() { local r=${1:-$?}; [ $# -gt 0 ] && shift; [ $r -eq 0 ] && echo ' [ ok ]' || echo \" $* \"'[ !! ]'; return $r; } >&2\n"
"dodir() { mkdir -p \"$@\"; }\n"
"keepdir() { dodir \"$@\" && touch \"$@\"/.keep_${CATEGORY}_${PN}-${SLOT%%/*}; }\n"
/* TODO: This should be fatal upon error */