]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bb.{cooker, data}: only emit a var as python if 'func' is set
authorChristopher Larson <chris_larson@mentor.com>
Sat, 30 Apr 2016 20:10:34 +0000 (13:10 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 6 May 2016 09:21:37 +0000 (10:21 +0100)
This avoids a common issue where PACKAGECONFIG is emitted as a function in
bitbake -e when the 'python' flag exists. It isn't a python function unless
both 'func' and 'python' are set. This aligns with the behavior of
emit_func_python.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/cooker.py
lib/bb/data.py

index 9b565fc37df04ddc83cd30517246ceb3e7953545..b2187d7d5ff42afdf0f0b4d6d09a2b75ea318999 100644 (file)
@@ -656,7 +656,7 @@ class BBCooker:
         # emit the metadata which isnt valid shell
         data.expandKeys(envdata)
         for e in envdata.keys():
-            if data.getVarFlag( e, 'python', envdata ):
+            if envdata.getVarFlag(e, 'func', False) and envdata.getVarFlag(e, 'python', False):
                 logger.plain("\npython %s () {\n%s}\n", e, envdata.getVar(e, False))
 
 
index dbc6dea68d8d9d9574d75f2560ed4e4c6552c18c..b5dcdbd8f8e767b1e313f0a3ad9a5c0ede24570b 100644 (file)
@@ -182,12 +182,12 @@ def inheritFromOS(d, savedenv, permitted):
 
 def emit_var(var, o=sys.__stdout__, d = init(), all=False):
     """Emit a variable to be sourced by a shell."""
-    if d.getVarFlag(var, "python", False):
+    func = d.getVarFlag(var, "func", False)
+    if d.getVarFlag(var, 'python', False) and func:
         return False
 
     export = d.getVarFlag(var, "export", False)
     unexport = d.getVarFlag(var, "unexport", False)
-    func = d.getVarFlag(var, "func", False)
     if not all and not export and not unexport and not func:
         return False