summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-04-03 11:19:04 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-05 23:19:17 +0100
commit7b7c238b2d6cf8a585afa3a0dfc9bdac111a2a33 (patch)
treeefccd1b2b72e3debdfc1c80cf36e774d8dcc623a /bitbake
parentf217b65f124fd81c15d48e2381bf2f575b96da0c (diff)
downloadpoky-7b7c238b2d6cf8a585afa3a0dfc9bdac111a2a33.tar.gz
bitbake: codeparser: improve handling of contains_any() and filter()
Ensure we handle bb.utils.contains_any() as separate items, rather than how we handle contains() where every item must be in the list. Additionally, enable handling bb.utils.filter() which for the purposes of looking at dependencies is the same as contains_any(). Additionally bump the codeparser cache and recipe cache versions to invalidate the user's existing caches (ensuring that the changes take effect and avoiding "taskhash mismatch" errors respectively). (Bitbake rev: 496e3c84820a2a889d99d3604659e47a550941d5) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/cache.py2
-rw-r--r--bitbake/lib/bb/codeparser.py11
2 files changed, 9 insertions, 4 deletions
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py
index c04ac13735..28e8a87455 100644
--- a/bitbake/lib/bb/cache.py
+++ b/bitbake/lib/bb/cache.py
@@ -37,7 +37,7 @@ import bb.utils
37 37
38logger = logging.getLogger("BitBake.Cache") 38logger = logging.getLogger("BitBake.Cache")
39 39
40__cache_version__ = "150" 40__cache_version__ = "151"
41 41
42def getCacheFile(path, filename, data_hash): 42def getCacheFile(path, filename, data_hash):
43 return os.path.join(path, filename + "." + data_hash) 43 return os.path.join(path, filename + "." + data_hash)
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py
index 89d24ab49a..f76b478a47 100644
--- a/bitbake/lib/bb/codeparser.py
+++ b/bitbake/lib/bb/codeparser.py
@@ -117,7 +117,7 @@ class shellCacheLine(object):
117 117
118class CodeParserCache(MultiProcessCache): 118class CodeParserCache(MultiProcessCache):
119 cache_file_name = "bb_codeparser.dat" 119 cache_file_name = "bb_codeparser.dat"
120 CACHE_VERSION = 8 120 CACHE_VERSION = 9
121 121
122 def __init__(self): 122 def __init__(self):
123 MultiProcessCache.__init__(self) 123 MultiProcessCache.__init__(self)
@@ -193,7 +193,8 @@ class BufferedLogger(Logger):
193class PythonParser(): 193class PythonParser():
194 getvars = (".getVar", ".appendVar", ".prependVar") 194 getvars = (".getVar", ".appendVar", ".prependVar")
195 getvarflags = (".getVarFlag", ".appendVarFlag", ".prependVarFlag") 195 getvarflags = (".getVarFlag", ".appendVarFlag", ".prependVarFlag")
196 containsfuncs = ("bb.utils.contains", "base_contains", "bb.utils.contains_any") 196 containsfuncs = ("bb.utils.contains", "base_contains")
197 containsanyfuncs = ("bb.utils.contains_any", "bb.utils.filter")
197 execfuncs = ("bb.build.exec_func", "bb.build.exec_task") 198 execfuncs = ("bb.build.exec_func", "bb.build.exec_task")
198 199
199 def warn(self, func, arg): 200 def warn(self, func, arg):
@@ -212,13 +213,17 @@ class PythonParser():
212 213
213 def visit_Call(self, node): 214 def visit_Call(self, node):
214 name = self.called_node_name(node.func) 215 name = self.called_node_name(node.func)
215 if name and (name.endswith(self.getvars) or name.endswith(self.getvarflags) or name in self.containsfuncs): 216 if name and (name.endswith(self.getvars) or name.endswith(self.getvarflags) or name in self.containsfuncs or name in self.containsanyfuncs):
216 if isinstance(node.args[0], ast.Str): 217 if isinstance(node.args[0], ast.Str):
217 varname = node.args[0].s 218 varname = node.args[0].s
218 if name in self.containsfuncs and isinstance(node.args[1], ast.Str): 219 if name in self.containsfuncs and isinstance(node.args[1], ast.Str):
219 if varname not in self.contains: 220 if varname not in self.contains:
220 self.contains[varname] = set() 221 self.contains[varname] = set()
221 self.contains[varname].add(node.args[1].s) 222 self.contains[varname].add(node.args[1].s)
223 elif name in self.containsanyfuncs and isinstance(node.args[1], ast.Str):
224 if varname not in self.contains:
225 self.contains[varname] = set()
226 self.contains[varname].update(node.args[1].s.split())
222 elif name.endswith(self.getvarflags): 227 elif name.endswith(self.getvarflags):
223 if isinstance(node.args[1], ast.Str): 228 if isinstance(node.args[1], ast.Str):
224 self.references.add('%s[%s]' % (varname, node.args[1].s)) 229 self.references.add('%s[%s]' % (varname, node.args[1].s))