diff options
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/data.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/utils.py | 24 |
2 files changed, 13 insertions, 13 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py index 53ce7d62d3..198b628fad 100644 --- a/bitbake/lib/bb/data.py +++ b/bitbake/lib/bb/data.py | |||
@@ -161,7 +161,7 @@ def expandKeys(alterdata, readdata = None): | |||
161 | 161 | ||
162 | def inheritFromOS(d): | 162 | def inheritFromOS(d): |
163 | """Inherit variables from the environment.""" | 163 | """Inherit variables from the environment.""" |
164 | exportlist = bb.utils.preserved_envvars_export_list() | 164 | exportlist = bb.utils.preserved_envvars_exported() |
165 | for s in os.environ.keys(): | 165 | for s in os.environ.keys(): |
166 | try: | 166 | try: |
167 | setVar(s, os.environ[s], d) | 167 | setVar(s, os.environ[s], d) |
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 48ed0d72e5..f04f4abe32 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -490,9 +490,9 @@ def sha256_file(filename): | |||
490 | s.update(line) | 490 | s.update(line) |
491 | return s.hexdigest() | 491 | return s.hexdigest() |
492 | 492 | ||
493 | # Variables which are preserved from the original environment *and* exported | 493 | def preserved_envvars_exported(): |
494 | # into our worker context | 494 | """Variables which are taken from the environment and placed in and exported |
495 | def preserved_envvars_export_list(): | 495 | from the metadata""" |
496 | return [ | 496 | return [ |
497 | 'BB_TASKHASH', | 497 | 'BB_TASKHASH', |
498 | 'HOME', | 498 | 'HOME', |
@@ -505,9 +505,9 @@ def preserved_envvars_export_list(): | |||
505 | 'USERNAME', | 505 | 'USERNAME', |
506 | ] | 506 | ] |
507 | 507 | ||
508 | # Variables which are preserved from the original environment *and* exported | 508 | def preserved_envvars_exported_interactive(): |
509 | # into our worker context for interactive tasks (e.g. requiring X) | 509 | """Variables which are taken from the environment and placed in and exported |
510 | def preserved_envvars_export_interactive_list(): | 510 | from the metadata, for interactive tasks""" |
511 | return [ | 511 | return [ |
512 | 'COLORTERM', | 512 | 'COLORTERM', |
513 | 'DBUS_SESSION_BUS_ADDRESS', | 513 | 'DBUS_SESSION_BUS_ADDRESS', |
@@ -525,8 +525,8 @@ def preserved_envvars_export_interactive_list(): | |||
525 | 'XDG_SESSION_COOKIE', | 525 | 'XDG_SESSION_COOKIE', |
526 | ] | 526 | ] |
527 | 527 | ||
528 | # Variables which are preserved from the original environment into the datastore | 528 | def preserved_envvars(): |
529 | def preserved_envvars_list(): | 529 | """Variables which are taken from the environment and placed in the metadata""" |
530 | v = [ | 530 | v = [ |
531 | 'BBPATH', | 531 | 'BBPATH', |
532 | 'BB_PRESERVE_ENV', | 532 | 'BB_PRESERVE_ENV', |
@@ -535,7 +535,7 @@ def preserved_envvars_list(): | |||
535 | 'LANG', | 535 | 'LANG', |
536 | '_', | 536 | '_', |
537 | ] | 537 | ] |
538 | return v + preserved_envvars_export_list() + preserved_envvars_export_interactive_list() | 538 | return v + preserved_envvars_exported() + preserved_envvars_exported_interactive() |
539 | 539 | ||
540 | def filter_environment(good_vars): | 540 | def filter_environment(good_vars): |
541 | """ | 541 | """ |
@@ -557,8 +557,8 @@ def filter_environment(good_vars): | |||
557 | 557 | ||
558 | return removed_vars | 558 | return removed_vars |
559 | 559 | ||
560 | def create_intereactive_env(d): | 560 | def create_interactive_env(d): |
561 | for k in preserved_envvars_export_interactive_list(): | 561 | for k in preserved_envvars_exported_interactive(): |
562 | os.setenv(k, bb.data.getVar(k, d, True)) | 562 | os.setenv(k, bb.data.getVar(k, d, True)) |
563 | 563 | ||
564 | def clean_environment(): | 564 | def clean_environment(): |
@@ -570,7 +570,7 @@ def clean_environment(): | |||
570 | if 'BB_ENV_WHITELIST' in os.environ: | 570 | if 'BB_ENV_WHITELIST' in os.environ: |
571 | good_vars = os.environ['BB_ENV_WHITELIST'].split() | 571 | good_vars = os.environ['BB_ENV_WHITELIST'].split() |
572 | else: | 572 | else: |
573 | good_vars = preserved_envvars_list() | 573 | good_vars = preserved_envvars() |
574 | if 'BB_ENV_EXTRAWHITE' in os.environ: | 574 | if 'BB_ENV_EXTRAWHITE' in os.environ: |
575 | good_vars.extend(os.environ['BB_ENV_EXTRAWHITE'].split()) | 575 | good_vars.extend(os.environ['BB_ENV_EXTRAWHITE'].split()) |
576 | filter_environment(good_vars) | 576 | filter_environment(good_vars) |