bitbake: bitbake-getvar: Treat undefined variables as empty with --value

Rather than outputting the string "None" for undefined variables, output
only a linefeed (the same as for variables that are defined to the empty
string).

(Bitbake rev: f3ba9c3726ec7b38b557100d8a2d4b6a1446a968)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Peter Kjellerstedt
2023-09-27 19:16:17 +02:00
committed by Richard Purdie
parent 826807785e
commit 3b46d6a41a

View File

@@ -55,6 +55,6 @@ if __name__ == "__main__":
if value is None and not args.ignore_undefined:
sys.exit(f"The variable '{args.variable}' is not defined")
if args.value:
print(str(value))
print(str(value if value is not None else ""))
else:
bb.data.emit_var(args.variable, d=d, all=True)