diff options
Diffstat (limited to 'bitbake/lib/bb/codeparser.py')
| -rw-r--r-- | bitbake/lib/bb/codeparser.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py index 6e34eff999..62b6cf9e3a 100644 --- a/bitbake/lib/bb/codeparser.py +++ b/bitbake/lib/bb/codeparser.py | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | import ast | 1 | import ast |
| 2 | import codegen | 2 | import codegen |
| 3 | import logging | 3 | import logging |
| 4 | import collections | ||
| 5 | import os.path | 4 | import os.path |
| 6 | import bb.utils, bb.data | 5 | import bb.utils, bb.data |
| 7 | from itertools import chain | 6 | from itertools import chain |
| @@ -65,6 +64,8 @@ class CodeParserCache(MultiProcessCache): | |||
| 65 | for h in data[0]: | 64 | for h in data[0]: |
| 66 | data[0][h]["refs"] = self.internSet(data[0][h]["refs"]) | 65 | data[0][h]["refs"] = self.internSet(data[0][h]["refs"]) |
| 67 | data[0][h]["execs"] = self.internSet(data[0][h]["execs"]) | 66 | data[0][h]["execs"] = self.internSet(data[0][h]["execs"]) |
| 67 | for k in data[0][h]["contains"]: | ||
| 68 | data[0][h]["contains"][k] = self.internSet(data[0][h]["contains"][k]) | ||
| 68 | for h in data[1]: | 69 | for h in data[1]: |
| 69 | data[1][h]["execs"] = self.internSet(data[1][h]["execs"]) | 70 | data[1][h]["execs"] = self.internSet(data[1][h]["execs"]) |
| 70 | return | 71 | return |
| @@ -125,6 +126,8 @@ class PythonParser(): | |||
| 125 | if isinstance(node.args[0], ast.Str): | 126 | if isinstance(node.args[0], ast.Str): |
| 126 | varname = node.args[0].s | 127 | varname = node.args[0].s |
| 127 | if name in self.containsfuncs and isinstance(node.args[1], ast.Str): | 128 | if name in self.containsfuncs and isinstance(node.args[1], ast.Str): |
| 129 | if varname not in self.contains: | ||
| 130 | self.contains[varname] = set() | ||
| 128 | self.contains[varname].add(node.args[1].s) | 131 | self.contains[varname].add(node.args[1].s) |
| 129 | else: | 132 | else: |
| 130 | self.references.add(node.args[0].s) | 133 | self.references.add(node.args[0].s) |
| @@ -153,10 +156,10 @@ class PythonParser(): | |||
| 153 | 156 | ||
| 154 | def __init__(self, name, log): | 157 | def __init__(self, name, log): |
| 155 | self.var_execs = set() | 158 | self.var_execs = set() |
| 156 | self.contains = collections.defaultdict(set) | 159 | self.contains = {} |
| 157 | self.execs = set() | 160 | self.execs = set() |
| 158 | self.references = set() | 161 | self.references = set() |
| 159 | self.log = BufferedLogger('BitBake.Data.%s' % name, logging.DEBUG, log) | 162 | self.log = BufferedLogger('BitBake.Data.PythonParser', logging.DEBUG, log) |
| 160 | 163 | ||
| 161 | self.unhandled_message = "in call of %s, argument '%s' is not a string literal" | 164 | self.unhandled_message = "in call of %s, argument '%s' is not a string literal" |
| 162 | self.unhandled_message = "while parsing %s, %s" % (name, self.unhandled_message) | 165 | self.unhandled_message = "while parsing %s, %s" % (name, self.unhandled_message) |
