[oe-commits] [bitbake] 02/04: Implement support for per-task exports

git at git.openembedded.org git at git.openembedded.org
Tue May 17 22:25:07 UTC 2016


rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 4506ccf1495c6ed6e8ed678f4baa166bc94d1761
Author: Christopher Larson <chris_larson at mentor.com>
AuthorDate: Sat Apr 30 12:52:48 2016 -0700

    Implement support for per-task exports
    
    Signed-off-by: Christopher Larson <chris_larson at mentor.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 bin/bitbake-worker | 10 ++++++++++
 lib/bb/data.py     |  4 +++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/bin/bitbake-worker b/bin/bitbake-worker
index 5fcffdd..6a6b26b 100755
--- a/bin/bitbake-worker
+++ b/bin/bitbake-worker
@@ -208,14 +208,24 @@ def fork_off_task(cfg, data, workerdata, fn, task, taskname, appends, taskdepdat
                 # exported_vars() returns a generator which *cannot* be passed to os.environ.update() 
                 # successfully. We also need to unset anything from the environment which shouldn't be there 
                 exports = bb.data.exported_vars(the_data)
+
                 bb.utils.empty_environment()
                 for e, v in exports:
                     os.environ[e] = v
+
                 for e in fakeenv:
                     os.environ[e] = fakeenv[e]
                     the_data.setVar(e, fakeenv[e])
                     the_data.setVarFlag(e, 'export', "1")
 
+                task_exports = the_data.getVarFlag(taskname, 'exports', True)
+                if task_exports:
+                    for e in task_exports.split():
+                        the_data.setVarFlag(e, 'export', '1')
+                        v = the_data.getVar(e, True)
+                        if v is not None:
+                            os.environ[e] = v
+
                 if quieterrors:
                     the_data.setVarFlag(taskname, "quieterrors", "1")
 
diff --git a/lib/bb/data.py b/lib/bb/data.py
index e9ce0ad..48d990d 100644
--- a/lib/bb/data.py
+++ b/lib/bb/data.py
@@ -339,7 +339,7 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
             deps |= parser.references
             deps = deps | (keys & parser.execs)
             return deps, value
-        varflags = d.getVarFlags(key, ["vardeps", "vardepvalue", "vardepsexclude", "vardepvalueexclude", "postfuncs", "prefuncs", "lineno", "filename"]) or {}
+        varflags = d.getVarFlags(key, ["vardeps", "vardepvalue", "vardepsexclude", "vardepvalueexclude", "exports", "postfuncs", "prefuncs", "lineno", "filename"]) or {}
         vardeps = varflags.get("vardeps")
         value = d.getVar(key, False)
 
@@ -383,6 +383,8 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
                 deps = deps | set(varflags["prefuncs"].split())
             if "postfuncs" in varflags:
                 deps = deps | set(varflags["postfuncs"].split())
+            if "exports" in varflags:
+                deps = deps | set(varflags["exports"].split())
         else:
             parser = d.expandWithRefs(value, key)
             deps |= parser.references

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list