diff options
-rw-r--r-- | bitbake/lib/bb/cache.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/codeparser.py | 19 |
2 files changed, 16 insertions, 5 deletions
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py index c48feb7138..958652e0e3 100644 --- a/bitbake/lib/bb/cache.py +++ b/bitbake/lib/bb/cache.py | |||
@@ -28,7 +28,7 @@ import shutil | |||
28 | 28 | ||
29 | logger = logging.getLogger("BitBake.Cache") | 29 | logger = logging.getLogger("BitBake.Cache") |
30 | 30 | ||
31 | __cache_version__ = "155" | 31 | __cache_version__ = "156" |
32 | 32 | ||
33 | def getCacheFile(path, filename, mc, data_hash): | 33 | def getCacheFile(path, filename, mc, data_hash): |
34 | mcspec = '' | 34 | mcspec = '' |
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py index b25a2133d2..d249af326e 100644 --- a/bitbake/lib/bb/codeparser.py +++ b/bitbake/lib/bb/codeparser.py | |||
@@ -87,14 +87,17 @@ def add_module_functions(fn, functions, namespace): | |||
87 | if e in functions: | 87 | if e in functions: |
88 | execs.remove(e) | 88 | execs.remove(e) |
89 | execs.add(namespace + "." + e) | 89 | execs.add(namespace + "." + e) |
90 | modulecode_deps[name] = [parser.references.copy(), execs, parser.var_execs.copy(), parser.contains.copy(), parser.extra] | 90 | visitorcode = None |
91 | if hasattr(functions[f], 'visitorcode'): | ||
92 | visitorcode = getattr(functions[f], "visitorcode") | ||
93 | modulecode_deps[name] = [parser.references.copy(), execs, parser.var_execs.copy(), parser.contains.copy(), parser.extra, visitorcode] | ||
91 | #bb.warn("%s: %s\nRefs:%s Execs: %s %s %s" % (name, fn, parser.references, parser.execs, parser.var_execs, parser.contains)) | 94 | #bb.warn("%s: %s\nRefs:%s Execs: %s %s %s" % (name, fn, parser.references, parser.execs, parser.var_execs, parser.contains)) |
92 | 95 | ||
93 | def update_module_dependencies(d): | 96 | def update_module_dependencies(d): |
94 | for mod in modulecode_deps: | 97 | for mod in modulecode_deps: |
95 | excludes = set((d.getVarFlag(mod, "vardepsexclude") or "").split()) | 98 | excludes = set((d.getVarFlag(mod, "vardepsexclude") or "").split()) |
96 | if excludes: | 99 | if excludes: |
97 | modulecode_deps[mod] = [modulecode_deps[mod][0] - excludes, modulecode_deps[mod][1] - excludes, modulecode_deps[mod][2] - excludes, modulecode_deps[mod][3], modulecode_deps[mod][4]] | 100 | modulecode_deps[mod] = [modulecode_deps[mod][0] - excludes, modulecode_deps[mod][1] - excludes, modulecode_deps[mod][2] - excludes, modulecode_deps[mod][3], modulecode_deps[mod][4], modulecode_deps[mod][5]] |
98 | 101 | ||
99 | # A custom getstate/setstate using tuples is actually worth 15% cachesize by | 102 | # A custom getstate/setstate using tuples is actually worth 15% cachesize by |
100 | # avoiding duplication of the attribute names! | 103 | # avoiding duplication of the attribute names! |
@@ -161,7 +164,7 @@ class CodeParserCache(MultiProcessCache): | |||
161 | # so that an existing cache gets invalidated. Additionally you'll need | 164 | # so that an existing cache gets invalidated. Additionally you'll need |
162 | # to increment __cache_version__ in cache.py in order to ensure that old | 165 | # to increment __cache_version__ in cache.py in order to ensure that old |
163 | # recipe caches don't trigger "Taskhash mismatch" errors. | 166 | # recipe caches don't trigger "Taskhash mismatch" errors. |
164 | CACHE_VERSION = 12 | 167 | CACHE_VERSION = 14 |
165 | 168 | ||
166 | def __init__(self): | 169 | def __init__(self): |
167 | MultiProcessCache.__init__(self) | 170 | MultiProcessCache.__init__(self) |
@@ -261,7 +264,15 @@ class PythonParser(): | |||
261 | 264 | ||
262 | def visit_Call(self, node): | 265 | def visit_Call(self, node): |
263 | name = self.called_node_name(node.func) | 266 | name = self.called_node_name(node.func) |
264 | if name and (name.endswith(self.getvars) or name.endswith(self.getvarflags) or name in self.containsfuncs or name in self.containsanyfuncs): | 267 | if name and name in modulecode_deps and modulecode_deps[name][5]: |
268 | visitorcode = modulecode_deps[name][5] | ||
269 | contains, execs, warn = visitorcode(name, node.args) | ||
270 | for i in contains: | ||
271 | self.contains[i] = contains[i] | ||
272 | self.execs |= execs | ||
273 | if warn: | ||
274 | self.warn(node.func, warn) | ||
275 | elif name and (name.endswith(self.getvars) or name.endswith(self.getvarflags) or name in self.containsfuncs or name in self.containsanyfuncs): | ||
265 | if isinstance(node.args[0], ast.Constant) and isinstance(node.args[0].value, str): | 276 | if isinstance(node.args[0], ast.Constant) and isinstance(node.args[0].value, str): |
266 | varname = node.args[0].value | 277 | varname = node.args[0].value |
267 | if name in self.containsfuncs and isinstance(node.args[1], ast.Constant): | 278 | if name in self.containsfuncs and isinstance(node.args[1], ast.Constant): |