summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2016-04-30 12:52:48 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-19 09:05:20 +0100
commit692b87497e99379a6cf6362636aa06093ebd643c (patch)
treeac8526bd64e4d9fb3115371b4bd59b291dcbeab0 /bitbake
parenta809f1c6afb8d3cf2309078103f5fbdbf071cf09 (diff)
downloadpoky-692b87497e99379a6cf6362636aa06093ebd643c.tar.gz
bitbake: Implement support for per-task exports
(Bitbake rev: 4506ccf1495c6ed6e8ed678f4baa166bc94d1761) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-xbitbake/bin/bitbake-worker10
-rw-r--r--bitbake/lib/bb/data.py4
2 files changed, 13 insertions, 1 deletions
diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker
index 5fcffddd4d..6a6b26b64a 100755
--- a/bitbake/bin/bitbake-worker
+++ b/bitbake/bin/bitbake-worker
@@ -208,14 +208,24 @@ def fork_off_task(cfg, data, workerdata, fn, task, taskname, appends, taskdepdat
208 # exported_vars() returns a generator which *cannot* be passed to os.environ.update() 208 # exported_vars() returns a generator which *cannot* be passed to os.environ.update()
209 # successfully. We also need to unset anything from the environment which shouldn't be there 209 # successfully. We also need to unset anything from the environment which shouldn't be there
210 exports = bb.data.exported_vars(the_data) 210 exports = bb.data.exported_vars(the_data)
211
211 bb.utils.empty_environment() 212 bb.utils.empty_environment()
212 for e, v in exports: 213 for e, v in exports:
213 os.environ[e] = v 214 os.environ[e] = v
215
214 for e in fakeenv: 216 for e in fakeenv:
215 os.environ[e] = fakeenv[e] 217 os.environ[e] = fakeenv[e]
216 the_data.setVar(e, fakeenv[e]) 218 the_data.setVar(e, fakeenv[e])
217 the_data.setVarFlag(e, 'export', "1") 219 the_data.setVarFlag(e, 'export', "1")
218 220
221 task_exports = the_data.getVarFlag(taskname, 'exports', True)
222 if task_exports:
223 for e in task_exports.split():
224 the_data.setVarFlag(e, 'export', '1')
225 v = the_data.getVar(e, True)
226 if v is not None:
227 os.environ[e] = v
228
219 if quieterrors: 229 if quieterrors:
220 the_data.setVarFlag(taskname, "quieterrors", "1") 230 the_data.setVarFlag(taskname, "quieterrors", "1")
221 231
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index e9ce0ad4d0..48d990dd16 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -339,7 +339,7 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
339 deps |= parser.references 339 deps |= parser.references
340 deps = deps | (keys & parser.execs) 340 deps = deps | (keys & parser.execs)
341 return deps, value 341 return deps, value
342 varflags = d.getVarFlags(key, ["vardeps", "vardepvalue", "vardepsexclude", "vardepvalueexclude", "postfuncs", "prefuncs", "lineno", "filename"]) or {} 342 varflags = d.getVarFlags(key, ["vardeps", "vardepvalue", "vardepsexclude", "vardepvalueexclude", "exports", "postfuncs", "prefuncs", "lineno", "filename"]) or {}
343 vardeps = varflags.get("vardeps") 343 vardeps = varflags.get("vardeps")
344 value = d.getVar(key, False) 344 value = d.getVar(key, False)
345 345
@@ -383,6 +383,8 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
383 deps = deps | set(varflags["prefuncs"].split()) 383 deps = deps | set(varflags["prefuncs"].split())
384 if "postfuncs" in varflags: 384 if "postfuncs" in varflags:
385 deps = deps | set(varflags["postfuncs"].split()) 385 deps = deps | set(varflags["postfuncs"].split())
386 if "exports" in varflags:
387 deps = deps | set(varflags["exports"].split())
386 else: 388 else:
387 parser = d.expandWithRefs(value, key) 389 parser = d.expandWithRefs(value, key)
388 deps |= parser.references 390 deps |= parser.references