1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-31 12:49:46 +00:00

bitbake/bitbake-dev: Allow much better control of which variable influence bitbake from the environment

git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5347 311d38ba-8fff-0310-9ca6-ca027cbcb966
This commit is contained in:
Richard Purdie
2008-09-30 20:57:18 +00:00
parent 221ac2b25f
commit 2e182847e4
8 changed files with 141 additions and 36 deletions
+6 -15
View File
@@ -324,21 +324,15 @@ def expandData(alterdata, readdata = None):
if val != expanded:
setVar(key, expanded, alterdata)
import os
def inheritFromOS(d):
"""Inherit variables from the environment."""
# fakeroot needs to be able to set these
non_inherit_vars = [ "LD_LIBRARY_PATH", "LD_PRELOAD" ]
for s in os.environ.keys():
if not s in non_inherit_vars:
try:
setVar(s, os.environ[s], d)
setVarFlag(s, 'matchesenv', '1', d)
except TypeError:
pass
import sys
try:
setVar(s, os.environ[s], d)
except TypeError:
pass
os.unsetenv(s)
del os.environ[s]
def emit_var(var, o=sys.__stdout__, d = init(), all=False):
"""Emit a variable to be sourced by a shell."""
@@ -379,9 +373,6 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False):
o.write('unset %s\n' % varExpanded)
return 1
if getVarFlag(var, 'matchesenv', d):
return 0
val.rstrip()
if not val:
return 0