diff mbox series

[bitbake-devel,1/2] bitbake-getvar: further supress warnings when quiet option is supplied

Message ID 20230926101440.3610057-1-Qi.Chen@windriver.com
State New
Headers show
Series [bitbake-devel,1/2] bitbake-getvar: further supress warnings when quiet option is supplied | expand

Commit Message

ChenQi Sept. 26, 2023, 10:14 a.m. UTC
From: Chen Qi <Qi.Chen@windriver.com>

When scripts rely on bitbake-getvar's output to get values, e.g.,
oe-find-native-sysroot, we need to ensure no warning message messes
things up.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 bin/bitbake-getvar | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Richard Purdie Sept. 26, 2023, 11:27 a.m. UTC | #1
On Tue, 2023-09-26 at 03:14 -0700, Chen Qi via lists.openembedded.org
wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
> 
> When scripts rely on bitbake-getvar's output to get values, e.g.,
> oe-find-native-sysroot, we need to ensure no warning message messes
> things up.
> 
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  bin/bitbake-getvar | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

I think Peter already sent something along these lines which just
merged?

Cheers,

Richard
ChenQi Sept. 26, 2023, 2:39 p.m. UTC | #2
Yes, indeed. 

Regards,
Qi

-----Original Message-----
From: Richard Purdie <richard.purdie@linuxfoundation.org> 
Sent: Tuesday, September 26, 2023 7:27 PM
To: Chen, Qi <Qi.Chen@windriver.com>; bitbake-devel@lists.openembedded.org
Subject: Re: [bitbake-devel][PATCH 1/2] bitbake-getvar: further supress warnings when quiet option is supplied

On Tue, 2023-09-26 at 03:14 -0700, Chen Qi via lists.openembedded.org
wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
> 
> When scripts rely on bitbake-getvar's output to get values, e.g., 
> oe-find-native-sysroot, we need to ensure no warning message messes 
> things up.
> 
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  bin/bitbake-getvar | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

I think Peter already sent something along these lines which just merged?

Cheers,

Richard
diff mbox series

Patch

diff --git a/bin/bitbake-getvar b/bin/bitbake-getvar
index 4a9eb4f31..6be194e42 100755
--- a/bin/bitbake-getvar
+++ b/bin/bitbake-getvar
@@ -37,11 +37,12 @@  if __name__ == "__main__":
         sys.exit(1)
 
     with bb.tinfoil.Tinfoil(tracking=True, setup_logging=not args.quiet) as tinfoil:
+        quiet_level = 3 if args.quiet else 2
         if args.recipe:
-            tinfoil.prepare(quiet=2)
+            tinfoil.prepare(quiet=quiet_level)
             d = tinfoil.parse_recipe(args.recipe)
         else:
-            tinfoil.prepare(quiet=2, config_only=True)
+            tinfoil.prepare(quiet=quiet_level, config_only=True)
             d = tinfoil.config_data
         if args.flag:
             print(str(d.getVarFlag(args.variable, args.flag, expand=(not args.unexpand))))