summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorQuentin Schulz <quentin.schulz@cherry.de>2025-03-25 10:07:54 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-03-25 21:20:41 +0000
commit5d81f07c16c7e3be8310158796f6c23eb15de74d (patch)
tree7c7e75beb30d9305863b2ef9b1810eb47c433d84 /scripts
parent743d30e8548b45658589ce5e2a25edaba2ce402d (diff)
downloadpoky-5d81f07c16c7e3be8310158796f6c23eb15de74d.tar.gz
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 <raj.khem@gmail.com> (From OE-Core rev: 225990c55a5cbf8498e2aa775e6406c27a4c0ea7) Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/b4-wrapper-poky.py10
1 files changed, 6 insertions, 4 deletions
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
53ref = None 53ref = None
54 54
55if not shutil.which("lsdiff"): 55if not shutil.which("lsdiff"):
56 print("lsdiff missing from host, please install patchutils") 56 print("lsdiff missing from host, please install patchutils", file=sys.stderr)
57 sys.exit(-1) 57 sys.exit(-1)
58 58
59try: 59try:
@@ -80,7 +80,7 @@ try:
80 break 80 break
81 81
82 if not ref: 82 if not ref:
83 print("Failed to find ref to cover letter (References:)...") 83 print("Failed to find ref to cover letter (References:)...", file=sys.stderr)
84 sys.exit(-2) 84 sys.exit(-2)
85 85
86 ref = ref.group(1) 86 ref = ref.group(1)
@@ -143,7 +143,8 @@ try:
143 143
144 if cmd == "prep-perpatch-check-cmd": 144 if cmd == "prep-perpatch-check-cmd":
145 if len(projs) > 1: 145 if len(projs) > 1:
146 print(f"Diff spans more than one project ({', '.join(sorted(projs))}), split into multiple commits...") 146 print(f"Diff spans more than one project ({', '.join(sorted(projs))}), split into multiple commits...",
147 file=sys.stderr)
147 sys.exit(-3) 148 sys.exit(-3)
148 149
149 # No need to check other patches in the series as there aren't any 150 # No need to check other patches in the series as there aren't any
@@ -164,7 +165,8 @@ try:
164 series_check.write_text('\n'.join(uniq_series_projs)) 165 series_check.write_text('\n'.join(uniq_series_projs))
165 166
166 if len(uniq_series_projs) > 1: 167 if len(uniq_series_projs) > 1:
167 print(f"Series spans more than one project ({', '.join(sorted(uniq_series_projs))}), split into multiple series...") 168 print(f"Series spans more than one project ({', '.join(sorted(uniq_series_projs))}), split into multiple series...",
169 file=sys.stderr)
168 sys.exit(-4) 170 sys.exit(-4)
169 else: # send-auto-cc-cmd / send-auto-to-cmd 171 else: # send-auto-cc-cmd / send-auto-to-cmd
170 ml_projs = { 172 ml_projs = {