summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2013-03-16 16:07:41 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-03-19 13:56:03 +0000
commitee416ad6f4b0209f7ad7d54467e0d7d5e097dd2a (patch)
tree39b7ca233e8ffa3f2a30c0cb00e088d11ed3fa69
parentaf9f5843d997455af66a2a1b63de530d14f1ff2b (diff)
downloadpoky-ee416ad6f4b0209f7ad7d54467e0d7d5e097dd2a.tar.gz
bitbake: utils.py: fix BB_ENV_WHITELIST
The BB_ENV_WHITELIST doesn't work well and flushes BB_ENV_EXTRAWHITE, here is an example: $ export BB_ENV_WHITELIST $ export BB_NUMBER_THREADS=10 (or other value) Edit conf/local.conf, change "BB_NUMBER_THREADS =" to "BB_NUMBER_THREADS ?=" $ bitbake -e | grep '^BB_NUMBER_THREADS =' we will notice that BB_NUMBER_THREADS' value doesn't change, though BB_NUMBER_THREADS in both BB_ENV_WHITELIST and BB_ENV_EXTRAWHITE. This is because the "approved" inside the function approved_variables doesn't include BB_ENV_WHITELIST or BB_ENV_EXTRAWHITE when BB_ENV_WHITELIST is set (they are incuded by preserved_envvars()), so the BB_ENV_WHITELIST and BB_ENV_EXTRAWHITE will be removed from the env in the first call from bin/bitbake, and when it is called again by cooker.py, their value will be None, then the vars inside them will be removed from the env. Add BB_ENV_WHITELIST and BB_ENV_EXTRAWHITE to the "approved" would fix the problem. [YOCTO #4031] (Bitbake rev: d2b07e6516dd308d0045a7fdb72b588af9d676ad) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/utils.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index b2f81c8a92..d671f56b50 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -496,10 +496,13 @@ def approved_variables():
496 approved = [] 496 approved = []
497 if 'BB_ENV_WHITELIST' in os.environ: 497 if 'BB_ENV_WHITELIST' in os.environ:
498 approved = os.environ['BB_ENV_WHITELIST'].split() 498 approved = os.environ['BB_ENV_WHITELIST'].split()
499 approved.extend(['BB_ENV_WHITELIST'])
499 else: 500 else:
500 approved = preserved_envvars() 501 approved = preserved_envvars()
501 if 'BB_ENV_EXTRAWHITE' in os.environ: 502 if 'BB_ENV_EXTRAWHITE' in os.environ:
502 approved.extend(os.environ['BB_ENV_EXTRAWHITE'].split()) 503 approved.extend(os.environ['BB_ENV_EXTRAWHITE'].split())
504 if 'BB_ENV_EXTRAWHITE' not in approved:
505 approved.extend(['BB_ENV_EXTRAWHITE'])
503 return approved 506 return approved
504 507
505def clean_environment(): 508def clean_environment():