diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2008-09-30 21:08:24 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2008-09-30 21:08:24 +0000 |
commit | e1737a7506856f0660bf0fcf05517e1337dba1df (patch) | |
tree | 13326096e097fa31f6c0e5930d0f61c24e22719f /bin | |
parent | 35562ac01ad18d3dc5374827e8fb5548a0a3537e (diff) | |
download | bitbake-e1737a7506856f0660bf0fcf05517e1337dba1df.tar.gz |
bin/bitbake: Add better environmental variable handling. By default it will now only pass certain whitelisted variables into the data store. If BB_PRESERVE_ENV is set bitbake will use all variable from the environment. If BB_ENV_WHITELIST is set, that whitelist will be used instead of the internal bitbake one. Alternatively, BB_ENV_EXTRAWHITE can be used to extend the internal whitelist.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/bitbake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/bitbake b/bin/bitbake index 6f0c9ed61..ef453a58a 100755 --- a/bin/bitbake +++ b/bin/bitbake @@ -140,6 +140,17 @@ Default BBFILES are the .bb files in the current directory.""" ) cooker = bb.cooker.BBCooker(configuration) + + # Optionally clean up the environment + if 'BB_PRESERVE_ENV' not in os.environ: + if 'BB_ENV_WHITELIST' in os.environ: + good_vars = os.environ['BB_ENV_WHITELIST'].split() + else: + good_vars = bb.utils.preserved_envvars_list() + if 'BB_ENV_EXTRAWHITE' in os.environ: + good_vars.extend(os.environ['BB_ENV_EXTRAWHITE'].split()) + bb.utils.filter_environment(good_vars) + cooker.parseConfiguration() host = cooker.server.host port = cooker.server.port |