summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-02 13:54:01 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-04 23:47:49 +0000
commit9913fd88d9399aedd58a39402673ba6aca28a118 (patch)
tree969ccfe5a47bcb8af17ddebddc1e203997cc5ab8 /bitbake
parent4628fe12e7f2767d243949197c8326e3b7396301 (diff)
downloadpoky-9913fd88d9399aedd58a39402673ba6aca28a118.tar.gz
bitbake: codeparser: Improve handling of data.expand() dependencies
Currently bitbake doesn't parse into data.expand() expressions, relying on high level expansion of python code to handle this. One of the tests does however test this works. We don't really want to be doing string expansion on python code, so specifically parse into expand() function calls so that when the high level behaviour is tweaked, the self tests continue to pass and that we do continue to handle expand() function calls as best we can. (Bitbake rev: b12c17be5e4a74c9680876605c87f46501f78d28) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/codeparser.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py
index 577b4271cf..2094f1337c 100644
--- a/bitbake/lib/bb/codeparser.py
+++ b/bitbake/lib/bb/codeparser.py
@@ -221,6 +221,17 @@ class PythonParser():
221 self.references.add(node.args[0].s) 221 self.references.add(node.args[0].s)
222 else: 222 else:
223 self.warn(node.func, node.args[0]) 223 self.warn(node.func, node.args[0])
224 elif name and name.endswith(".expand"):
225 if isinstance(node.args[0], ast.Str):
226 value = node.args[0].s
227 d = bb.data.init()
228 parser = d.expandWithRefs(value, self.name)
229 self.references |= parser.references
230 self.execs |= parser.execs
231 for varname in parser.contains:
232 if varname not in self.contains:
233 self.contains[varname] = set()
234 self.contains[varname] |= parser.contains[varname]
224 elif name in self.execfuncs: 235 elif name in self.execfuncs:
225 if isinstance(node.args[0], ast.Str): 236 if isinstance(node.args[0], ast.Str):
226 self.var_execs.add(node.args[0].s) 237 self.var_execs.add(node.args[0].s)
@@ -243,6 +254,7 @@ class PythonParser():
243 break 254 break
244 255
245 def __init__(self, name, log): 256 def __init__(self, name, log):
257 self.name = name
246 self.var_execs = set() 258 self.var_execs = set()
247 self.contains = {} 259 self.contains = {}
248 self.execs = set() 260 self.execs = set()