From: Quentin Schulz Date: Tue, 25 Mar 2025 09:07:54 +0000 (+0100) Subject: b4-wrapper-poky.py: output errors to stderr X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=225990c55a5cbf8498e2aa775e6406c27a4c0ea7;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git b4-wrapper-poky.py: output errors to stderr Print error messages to stderr instead of stdout. The commands run as part of send-auto-cc-cmd and send-auto-to-cmd b4 commands will make b4 raise an Exception if they return a non-zero return code and it will only print the content of stderr before that. Because print defaults to stdout, b4 would raise the exception and not tell the user why. This commit should now provide a hint to the user about what went wrong. Reported-by: Khem Raj Signed-off-by: Quentin Schulz Signed-off-by: Richard Purdie --- diff --git a/scripts/b4-wrapper-poky.py b/scripts/b4-wrapper-poky.py index ec6568eb9b..f1170db06b 100755 --- a/scripts/b4-wrapper-poky.py +++ b/scripts/b4-wrapper-poky.py @@ -53,7 +53,7 @@ subject = None ref = None if not shutil.which("lsdiff"): - print("lsdiff missing from host, please install patchutils") + print("lsdiff missing from host, please install patchutils", file=sys.stderr) sys.exit(-1) try: @@ -80,7 +80,7 @@ try: break if not ref: - print("Failed to find ref to cover letter (References:)...") + print("Failed to find ref to cover letter (References:)...", file=sys.stderr) sys.exit(-2) ref = ref.group(1) @@ -143,7 +143,8 @@ try: if cmd == "prep-perpatch-check-cmd": if len(projs) > 1: - print(f"Diff spans more than one project ({', '.join(sorted(projs))}), split into multiple commits...") + print(f"Diff spans more than one project ({', '.join(sorted(projs))}), split into multiple commits...", + file=sys.stderr) sys.exit(-3) # No need to check other patches in the series as there aren't any @@ -164,7 +165,8 @@ try: series_check.write_text('\n'.join(uniq_series_projs)) if len(uniq_series_projs) > 1: - print(f"Series spans more than one project ({', '.join(sorted(uniq_series_projs))}), split into multiple series...") + print(f"Series spans more than one project ({', '.join(sorted(uniq_series_projs))}), split into multiple series...", + file=sys.stderr) sys.exit(-4) else: # send-auto-cc-cmd / send-auto-to-cmd ml_projs = {