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 | poky-d5a137475a69c438f70cc2c422d4eb1e0f2abc7e.tar.gz |
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(): | |||
381 | os.unsetenv(s) | 381 | os.unsetenv(s) |
382 | del os.environ[s] | 382 | del os.environ[s] |
383 | 383 | ||
384 | def build_environment(d): | ||
385 | """ | ||
386 | Build an environment from all exported variables. | ||
387 | """ | ||
388 | import bb | ||
389 | for var in bb.data.keys(d): | ||
390 | export = bb.data.getVarFlag(var, "export", d) | ||
391 | if export: | ||
392 | os.environ[var] = bb.data.getVar(var, d, True) | ||
393 | |||
384 | def prunedir(topdir): | 394 | def prunedir(topdir): |
385 | # Delete everything reachable from the directory named in 'topdir'. | 395 | # Delete everything reachable from the directory named in 'topdir'. |
386 | # CAUTION: This is dangerous! | 396 | # CAUTION: This is dangerous! |