All of lore.kernel.org
 help / color / mirror / Atom feed
* [master][PATCH] bb.{cooker, data}: only emit a var as python if 'func' is set
@ 2016-04-30 20:10 Christopher Larson
  0 siblings, 0 replies; only message in thread
From: Christopher Larson @ 2016-04-30 20:10 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Christopher Larson

From: Christopher Larson <chris_larson@mentor.com>

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>
---
 lib/bb/cooker.py | 2 +-
 lib/bb/data.py   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 9b565fc..b2187d7 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -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))
 
 
diff --git a/lib/bb/data.py b/lib/bb/data.py
index dbc6dea..b5dcdbd 100644
--- a/lib/bb/data.py
+++ b/lib/bb/data.py
@@ -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
 
-- 
2.8.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-30 20:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-30 20:10 [master][PATCH] bb.{cooker, data}: only emit a var as python if 'func' is set Christopher Larson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.