summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data.py
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-11-28 17:39:09 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2010-12-09 13:16:14 +0000
commit0ba9a9fffee966ec912eec5fd52c468338560e6a (patch)
tree667079024d685b4f7ed1be59d3f23b7e00e97b2b /bitbake/lib/bb/data.py
parent39dd60462c6d1e87f7c4105e1a3913e0aa54dba0 (diff)
downloadast2050-yocto-poky-0ba9a9fffee966ec912eec5fd52c468338560e6a.zip
ast2050-yocto-poky-0ba9a9fffee966ec912eec5fd52c468338560e6a.tar.gz
bitbake: Overhaul environment handling
Currently, anything whitelisted in the environment makes it into the worker processes. This is undesireable and the worker environment should be as clean as possible. This patch adapts bitbake sosme variables are loaded into bitbake's datastore but not exported by default. Any variable can be exported by setting its export flag. Currently, this code only finalises the environment in he worker as doing so in the server means variables are unavailable in the worker. If we switch back to fork() calls instead of exec() this code will need revisting. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/data.py')
-rw-r--r--bitbake/lib/bb/data.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index fee10cc..d4d43fd 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -161,10 +161,12 @@ def expandKeys(alterdata, readdata = None):
def inheritFromOS(d):
"""Inherit variables from the environment."""
+ exportlist = bb.utils.preserved_envvars_export_list()
for s in os.environ.keys():
try:
setVar(s, os.environ[s], d)
- setVarFlag(s, "export", True, d)
+ if s in exportlist:
+ setVarFlag(s, "export", True, d)
except TypeError:
pass
@@ -244,6 +246,12 @@ def export_vars(d):
pass
return ret
+def export_envvars(v, d):
+ for s in os.environ.keys():
+ if s not in v:
+ v[s] = os.environ[s]
+ return v
+
def emit_func(func, o=sys.__stdout__, d = init()):
"""Emits all items in the data store in a format such that it can be sourced by a shell."""
OpenPOWER on IntegriCloud