From d5a137475a69c438f70cc2c422d4eb1e0f2abc7e Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 2 Jul 2009 14:33:53 +0100 Subject: bitbake: Add build_environment function for building an environment based on the data dictonary Signed-off-by: Richard Purdie --- bitbake-dev/lib/bb/utils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bitbake-dev/lib') 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! -- cgit v1.2.3