Skip to contentSkip to conversation

bitbake-getvar: Make --value imply --quiet

PATCH Peter Kjellerstedt 1 participant 1 message Sep 23, 2023 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 20 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Peter Kjellerstedt
Sent: den 23 september 2023 05:50
To: [email protected]
Subject: [bitbake-devel] [PATCH] bitbake-getvar: Make --value imply --quiet

It does not make any sense to get log output from bitbake-getvar when the --value option is used as the log output is sent to stdout and thus interferes with the output of the variable's value.

---
 bitbake/bin/bitbake-getvar | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
bitbake/bin/bitbake-getvar +0 -0
index 4a9eb4f311..1ec90065a9 100755

bitbake/bin/bitbake-getvar if __name__ == "__main__": · line 43

Quoted 9 lines
bitbake/bin/bitbake-getvar +2 -1
@@ -36,7 +36,8 @@ if __name__ == "__main__":
         print("--flag only makes sense with --value")
         sys.exit(1)
 
-    with bb.tinfoil.Tinfoil(tracking=True, setup_logging=not args.quiet) as tinfoil:
+    quiet = args.quiet or args.value
+    with bb.tinfoil.Tinfoil(tracking=True, setup_logging=not quiet) as tinfoil:
         if args.recipe:
             tinfoil.prepare(quiet=2)
             d = tinfoil.parse_recipe(args.recipe)

Hold off on this. I just noticed that using the --quiet option together with the --recipe option is broken (in the existing code). I have a fix in the works.

//Peter