diff options
Diffstat (limited to 'bitbake/lib/bb/codeparser.py')
-rw-r--r-- | bitbake/lib/bb/codeparser.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py index 4bc6adbe45..4f70cf7fe7 100644 --- a/bitbake/lib/bb/codeparser.py +++ b/bitbake/lib/bb/codeparser.py | |||
@@ -69,7 +69,7 @@ def add_module_functions(fn, functions, namespace): | |||
69 | name = "%s.%s" % (namespace, f) | 69 | name = "%s.%s" % (namespace, f) |
70 | parser = PythonParser(name, logger) | 70 | parser = PythonParser(name, logger) |
71 | try: | 71 | try: |
72 | parser.parse_python(None, filename=fn, lineno=1, fixedhash=fixedhash+f) | 72 | parser.parse_python(None, filename=fn, lineno=1, fixedhash=fixedhash+f, func=functions[f]) |
73 | #bb.warn("Cached %s" % f) | 73 | #bb.warn("Cached %s" % f) |
74 | except KeyError: | 74 | except KeyError: |
75 | try: | 75 | try: |
@@ -87,7 +87,7 @@ def add_module_functions(fn, functions, namespace): | |||
87 | # Builtin | 87 | # Builtin |
88 | continue | 88 | continue |
89 | src = "".join(lines) | 89 | src = "".join(lines) |
90 | parser.parse_python(src, filename=fn, lineno=lineno, fixedhash=fixedhash+f) | 90 | parser.parse_python(src, filename=fn, lineno=lineno, fixedhash=fixedhash+f, func=functions[f]) |
91 | #bb.warn("Not cached %s" % f) | 91 | #bb.warn("Not cached %s" % f) |
92 | execs = parser.execs.copy() | 92 | execs = parser.execs.copy() |
93 | # Expand internal module exec references | 93 | # Expand internal module exec references |
@@ -348,7 +348,7 @@ class PythonParser(): | |||
348 | # For the python module code it is expensive to have the function text so it is | 348 | # For the python module code it is expensive to have the function text so it is |
349 | # uses a different fixedhash to cache against. We can take the hit on obtaining the | 349 | # uses a different fixedhash to cache against. We can take the hit on obtaining the |
350 | # text if it isn't in the cache. | 350 | # text if it isn't in the cache. |
351 | def parse_python(self, node, lineno=0, filename="<string>", fixedhash=None): | 351 | def parse_python(self, node, lineno=0, filename="<string>", fixedhash=None, func=None): |
352 | if not fixedhash and (not node or not node.strip()): | 352 | if not fixedhash and (not node or not node.strip()): |
353 | return | 353 | return |
354 | 354 | ||
@@ -390,6 +390,10 @@ class PythonParser(): | |||
390 | if n.__class__.__name__ == "Call": | 390 | if n.__class__.__name__ == "Call": |
391 | self.visit_Call(n) | 391 | self.visit_Call(n) |
392 | 392 | ||
393 | if func is not None: | ||
394 | self.references |= getattr(func, "bb_vardeps", set()) | ||
395 | self.references -= getattr(func, "bb_vardepsexclude", set()) | ||
396 | |||
393 | self.execs.update(self.var_execs) | 397 | self.execs.update(self.var_execs) |
394 | self.extra = None | 398 | self.extra = None |
395 | if fixedhash: | 399 | if fixedhash: |