diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2009-07-23 17:46:20 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-07-23 17:46:20 +0100 |
commit | 720df03c5c45810d8ef89a8dbca6edb9301ca262 (patch) | |
tree | b1483d855cd524df00cdca2e1dc87c91102314ca /lib/bb/utils.py | |
parent | fa8ea72686fc851d827bdc8ac3540def0387330e (diff) | |
download | bitbake-720df03c5c45810d8ef89a8dbca6edb9301ca262.tar.gz |
utils.py: Add build_environment function (from Poky)
Add a function to bring the command environment in sync with the data
dictonary.
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'lib/bb/utils.py')
-rw-r--r-- | lib/bb/utils.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/bb/utils.py b/lib/bb/utils.py index 230e06ab9..603c92642 100644 --- a/lib/bb/utils.py +++ b/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! |