build: ensure silent Make behavior for json scripts
authorMichael Pratt <mcpratt@pm.me>
Fri, 24 Nov 2023 10:10:12 +0000 (05:10 -0500)
committerChristian Marangi <ansuelsmth@gmail.com>
Fri, 5 Jan 2024 15:25:14 +0000 (16:25 +0100)
Run the invocation of Make with verbosity in order to
prevent the printing of Makefile level and subtarget status.
e.g.  make[3] -C target/linux val.DEFAULT_PACKAGES val.ARCH_PACKAGES

Remove piping of stderr, which is only useful when using
the "communicate" method over the "run" method,
and this script would not be written to handle a captured error anyway.

For error testing, stdout and stderr can be set to a file object
with the open() function like this:

out = open('json_out', 'w')
err = open('json_err', 'w')

...
...
stdout=out,
stderr=err,

Signed-off-by: Michael Pratt <mcpratt@pm.me>
scripts/json_overview_image_info.py

index 89b7d4fe202c3859b2e3f12341f1252196448b56..0d2cf7f1ef5134d9b9edcc01fcde205844b4e268 100755 (executable)
@@ -55,9 +55,9 @@ if output:
             "target/linux/",
             "val.DEFAULT_PACKAGES",
             "val.ARCH_PACKAGES",
+            "V=s",
         ],
         stdout=PIPE,
-        stderr=PIPE,
         check=True,
         env=environ.copy().update({"TOPDIR": Path().cwd()}),
         universal_newlines=True,