summaryrefslogtreecommitdiff
path: root/bitbake-dev/lib
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake-dev/lib')
-rw-r--r--bitbake-dev/lib/bb/utils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/bitbake-dev/lib/bb/utils.py b/bitbake-dev/lib/bb/utils.py
index 230e06ab9..603c92642 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!