summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-17 11:42:28 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-18 10:59:27 +0100
commit9248bc1c53417e6581aa33fda683e765ad866426 (patch)
treea0ec636a8912b60922105e4a5218c2d272c592b1 /bitbake/lib/bb/data.py
parentf5181b36d66fb8d92b2eb9072e76aa4c13fccb33 (diff)
downloadpoky-9248bc1c53417e6581aa33fda683e765ad866426.tar.gz
bitbake: data/data_smart: Allow getVarFlag to return the variable parser object
(Bitbake rev: 136100dc932c9019737f927d826955425134010f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/data.py')
-rw-r--r--bitbake/lib/bb/data.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index 80a7879cb6..e2700077c3 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -283,14 +283,12 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
283 try: 283 try:
284 if key[-1] == ']': 284 if key[-1] == ']':
285 vf = key[:-1].split('[') 285 vf = key[:-1].split('[')
286 value = d.getVarFlag(vf[0], vf[1], False) 286 value, parser = d.getVarFlag(vf[0], vf[1], False, retparser=True)
287 parser = d.expandWithRefs(value, key)
288 deps |= parser.references 287 deps |= parser.references
289 deps = deps | (keys & parser.execs) 288 deps = deps | (keys & parser.execs)
290 return deps, value 289 return deps, value
291 varflags = d.getVarFlags(key, ["vardeps", "vardepvalue", "vardepsexclude", "exports", "postfuncs", "prefuncs", "lineno", "filename"]) or {} 290 varflags = d.getVarFlags(key, ["vardeps", "vardepvalue", "vardepsexclude", "exports", "postfuncs", "prefuncs", "lineno", "filename"]) or {}
292 vardeps = varflags.get("vardeps") 291 vardeps = varflags.get("vardeps")
293 value = d.getVarFlag(key, "_content", False)
294 292
295 def handle_contains(value, contains, d): 293 def handle_contains(value, contains, d):
296 newvalue = "" 294 newvalue = ""
@@ -310,9 +308,10 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
310 return value + newvalue 308 return value + newvalue
311 309
312 if "vardepvalue" in varflags: 310 if "vardepvalue" in varflags:
313 value = varflags.get("vardepvalue") 311 value = varflags.get("vardepvalue")
314 elif varflags.get("func"): 312 elif varflags.get("func"):
315 if varflags.get("python"): 313 if varflags.get("python"):
314 value = d.getVarFlag(key, "_content", False)
316 parser = bb.codeparser.PythonParser(key, logger) 315 parser = bb.codeparser.PythonParser(key, logger)
317 if value and "\t" in value: 316 if value and "\t" in value:
318 logger.warning("Variable %s contains tabs, please remove these (%s)" % (key, d.getVar("FILE"))) 317 logger.warning("Variable %s contains tabs, please remove these (%s)" % (key, d.getVar("FILE")))
@@ -321,7 +320,7 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
321 deps = deps | (keys & parser.execs) 320 deps = deps | (keys & parser.execs)
322 value = handle_contains(value, parser.contains, d) 321 value = handle_contains(value, parser.contains, d)
323 else: 322 else:
324 parsedvar = d.expandWithRefs(value, key) 323 value, parsedvar = d.getVarFlag(key, "_content", False, retparser=True)
325 parser = bb.codeparser.ShellParser(key, logger) 324 parser = bb.codeparser.ShellParser(key, logger)
326 parser.parse_shell(parsedvar.value) 325 parser.parse_shell(parsedvar.value)
327 deps = deps | shelldeps 326 deps = deps | shelldeps
@@ -337,7 +336,7 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
337 if "exports" in varflags: 336 if "exports" in varflags:
338 deps = deps | set(varflags["exports"].split()) 337 deps = deps | set(varflags["exports"].split())
339 else: 338 else:
340 parser = d.expandWithRefs(value, key) 339 value, parser = d.getVarFlag(key, "_content", False, retparser=True)
341 deps |= parser.references 340 deps |= parser.references
342 deps = deps | (keys & parser.execs) 341 deps = deps | (keys & parser.execs)
343 value = handle_contains(value, parser.contains, d) 342 value = handle_contains(value, parser.contains, d)