diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2009-07-02 14:33:53 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-07-02 14:33:53 +0100 |
commit | d5a137475a69c438f70cc2c422d4eb1e0f2abc7e (patch) | |
tree | e0823281cfba3cd6e7e154f6aaf310e06d20e4e7 /bitbake-dev | |
parent | 03873c0625607e3f290c9d3ada09e971dbab2921 (diff) | |
download | openembedded-core-d5a137475a69c438f70cc2c422d4eb1e0f2abc7e.tar.gz openembedded-core-d5a137475a69c438f70cc2c422d4eb1e0f2abc7e.tar.bz2 openembedded-core-d5a137475a69c438f70cc2c422d4eb1e0f2abc7e.zip |
bitbake: Add build_environment function for building an environment based on the data dictonary
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake-dev')
-rw-r--r-- | bitbake-dev/lib/bb/utils.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bitbake-dev/lib/bb/utils.py b/bitbake-dev/lib/bb/utils.py index 230e06ab95..603c926422 100644 --- a/bitbake-dev/lib/bb/utils.py +++ b/bitbake-dev/lib/bb/utils.py @@ -381,6 +381,16 @@ def empty_environment(): os.unsetenv(s) del os.environ[s] +def build_environment(d): + """ + Build an environment from all exported variables. + """ + import bb + for var in bb.data.keys(d): + export = bb.data.getVarFlag(var, "export", d) + if export: + os.environ[var] = bb.data.getVar(var, d, True) + def prunedir(topdir): # Delete everything reachable from the directory named in 'topdir'. # CAUTION: This is dangerous! |