bitbake: Add build_environment function for building an environment based on the data dictonary
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
parent
03873c0625
commit
d5a137475a
|
@ -381,6 +381,16 @@ def empty_environment():
|
||||||
os.unsetenv(s)
|
os.unsetenv(s)
|
||||||
del os.environ[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):
|
def prunedir(topdir):
|
||||||
# Delete everything reachable from the directory named in 'topdir'.
|
# Delete everything reachable from the directory named in 'topdir'.
|
||||||
# CAUTION: This is dangerous!
|
# CAUTION: This is dangerous!
|
||||||
|
|
|
@ -381,6 +381,16 @@ def empty_environment():
|
||||||
os.unsetenv(s)
|
os.unsetenv(s)
|
||||||
del os.environ[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):
|
def prunedir(topdir):
|
||||||
# Delete everything reachable from the directory named in 'topdir'.
|
# Delete everything reachable from the directory named in 'topdir'.
|
||||||
# CAUTION: This is dangerous!
|
# CAUTION: This is dangerous!
|
||||||
|
|
Loading…
Reference in New Issue