Patchwork [bitbake-devel] codeparser: Track bb.utils.contains usage

mail settings
Submitter Richard Purdie
Date Feb. 14, 2013, 9:59 p.m.
Message ID <1360879161.11225.128.camel@ted>
Download mbox | patch
Permalink /patch/44675/
State New
Headers show


Richard Purdie - Feb. 14, 2013, 9:59 p.m.
The bb.utils.contains function usage is getting increasingly used in the metadata
but isn't handled automatically by the python dependency tracking code. This patch
changes that and also adds the "OE" names for the functions.

Whilst there are reasons this is a bad idea, its likely outweighed by the
shear number of these references and the current holes in dependency information
which we're now relying heavily upon.

Signed-off-by: Richard Purdie <>


diff --git a/bitbake/lib/bb/ b/bitbake/lib/bb/
index 979e6bd..78f82e1 100644
--- a/bitbake/lib/bb/
+++ b/bitbake/lib/bb/
@@ -101,6 +101,7 @@  class BufferedLogger(Logger):
 class PythonParser():
     getvars = ("d.getVar", "", "data.getVar", "d.appendVar", "d.prependVar")
+    containsfuncs = ("bb.utils.contains", "base_contains", "oe.utils.contains")
     execfuncs = ("", "")
     def warn(self, func, arg):
@@ -119,7 +120,7 @@  class PythonParser():
     def visit_Call(self, node):
         name = self.called_node_name(node.func)
-        if name in self.getvars:
+        if name in self.getvars or name in self.containsfuncs:
             if isinstance(node.args[0], ast.Str):