From: Lukas Funke <[email protected]>

Go will download verious modules during vendoring and tell us about
it, i.e. "go: downloading foo/bar vX.Y.Z". These lines are mixed with the
relevant modules.txt lines. Thus, ignore log messages starting with
"go: .*".

Signed-off-by: Lukas Funke <[email protected]>
---
 scripts/lib/recipetool/create_go.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/lib/recipetool/create_go.py 
b/scripts/lib/recipetool/create_go.py
index abe1f6e0da..cae7175a33 100644
--- a/scripts/lib/recipetool/create_go.py
+++ b/scripts/lib/recipetool/create_go.py
@@ -615,10 +615,15 @@ class GoRecipeHandler(RecipeHandler):
         _, stderr = self.__go_run_cmd(
             "go mod vendor -v -o %s" % (tmp_vendor_dir), srctree, d)
 
+        # ignore miscellaneous go log messages
+        vedoring_log = [x for x in stderr.splitlines() \
+                            if not x.startswith("go: ")]
+
         modules_txt_basename = "modules.txt"
         modules_txt_filename = os.path.join(localfilesdir, 
modules_txt_basename)
         with open(modules_txt_filename, "w") as f:
-            f.write(stderr)
+            f.write('\n'.join(vedoring_log))
+            f.write('\n') # don't forget the trailing newline
 
         extravalues['extrafiles'][modules_txt_basename] = modules_txt_filename
 
-- 
2.30.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#196210): 
https://lists.openembedded.org/g/openembedded-core/message/196210
Mute This Topic: https://lists.openembedded.org/mt/104582951/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to