diff options
Diffstat (limited to 'bitbake/lib/bb/utils.py')
| -rw-r--r-- | bitbake/lib/bb/utils.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 484fb2dc76..b1a0f25e75 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
| @@ -474,17 +474,17 @@ def filter_environment(good_vars): | |||
| 474 | are not known and may influence the build in a negative way. | 474 | are not known and may influence the build in a negative way. |
| 475 | """ | 475 | """ |
| 476 | 476 | ||
| 477 | removed_vars = [] | 477 | removed_vars = {} |
| 478 | for key in os.environ.keys(): | 478 | for key in os.environ.keys(): |
| 479 | if key in good_vars: | 479 | if key in good_vars: |
| 480 | continue | 480 | continue |
| 481 | 481 | ||
| 482 | removed_vars.append(key) | 482 | removed_vars[key] = os.environ[key] |
| 483 | os.unsetenv(key) | 483 | os.unsetenv(key) |
| 484 | del os.environ[key] | 484 | del os.environ[key] |
| 485 | 485 | ||
| 486 | if len(removed_vars): | 486 | if len(removed_vars): |
| 487 | logger.debug(1, "Removed the following variables from the environment: %s", ", ".join(removed_vars)) | 487 | logger.debug(1, "Removed the following variables from the environment: %s", ", ".join(removed_vars.keys())) |
| 488 | 488 | ||
| 489 | return removed_vars | 489 | return removed_vars |
| 490 | 490 | ||
| @@ -509,7 +509,9 @@ def clean_environment(): | |||
| 509 | """ | 509 | """ |
| 510 | if 'BB_PRESERVE_ENV' not in os.environ: | 510 | if 'BB_PRESERVE_ENV' not in os.environ: |
| 511 | good_vars = approved_variables() | 511 | good_vars = approved_variables() |
| 512 | filter_environment(good_vars) | 512 | return filter_environment(good_vars) |
| 513 | |||
| 514 | return {} | ||
| 513 | 515 | ||
| 514 | def empty_environment(): | 516 | def empty_environment(): |
| 515 | """ | 517 | """ |
