summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2009-07-02 14:33:53 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2009-07-02 14:33:53 +0100
commitd5a137475a69c438f70cc2c422d4eb1e0f2abc7e (patch)
treee0823281cfba3cd6e7e154f6aaf310e06d20e4e7
parent03873c0625607e3f290c9d3ada09e971dbab2921 (diff)
downloadpoky-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>
-rw-r--r--bitbake-dev/lib/bb/utils.py10
-rw-r--r--bitbake/lib/bb/utils.py10
2 files changed, 20 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
384def 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
384def prunedir(topdir): 394def 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!
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 2469bd7ee2..3017ecfa4a 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/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
384def 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
384def prunedir(topdir): 394def 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!