diff options
Diffstat (limited to 'bitbake/lib/bb/data.py')
-rw-r--r-- | bitbake/lib/bb/data.py | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py index 54b2615afb..82eef44989 100644 --- a/bitbake/lib/bb/data.py +++ b/bitbake/lib/bb/data.py | |||
@@ -324,21 +324,15 @@ def expandData(alterdata, readdata = None): | |||
324 | if val != expanded: | 324 | if val != expanded: |
325 | setVar(key, expanded, alterdata) | 325 | setVar(key, expanded, alterdata) |
326 | 326 | ||
327 | import os | ||
328 | |||
329 | def inheritFromOS(d): | 327 | def inheritFromOS(d): |
330 | """Inherit variables from the environment.""" | 328 | """Inherit variables from the environment.""" |
331 | # fakeroot needs to be able to set these | ||
332 | non_inherit_vars = [ "LD_LIBRARY_PATH", "LD_PRELOAD" ] | ||
333 | for s in os.environ.keys(): | 329 | for s in os.environ.keys(): |
334 | if not s in non_inherit_vars: | 330 | try: |
335 | try: | 331 | setVar(s, os.environ[s], d) |
336 | setVar(s, os.environ[s], d) | 332 | except TypeError: |
337 | setVarFlag(s, 'matchesenv', '1', d) | 333 | pass |
338 | except TypeError: | 334 | os.unsetenv(s) |
339 | pass | 335 | del os.environ[s] |
340 | |||
341 | import sys | ||
342 | 336 | ||
343 | def emit_var(var, o=sys.__stdout__, d = init(), all=False): | 337 | def emit_var(var, o=sys.__stdout__, d = init(), all=False): |
344 | """Emit a variable to be sourced by a shell.""" | 338 | """Emit a variable to be sourced by a shell.""" |
@@ -379,9 +373,6 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False): | |||
379 | o.write('unset %s\n' % varExpanded) | 373 | o.write('unset %s\n' % varExpanded) |
380 | return 1 | 374 | return 1 |
381 | 375 | ||
382 | if getVarFlag(var, 'matchesenv', d): | ||
383 | return 0 | ||
384 | |||
385 | val.rstrip() | 376 | val.rstrip() |
386 | if not val: | 377 | if not val: |
387 | return 0 | 378 | return 0 |