Patchwork [bitbake-devel] utils: Fix BB_PRESERVE_ENV

mail settings
Submitter Richard Purdie
Date Sept. 11, 2013, 10:01 a.m.
Message ID <1378893707.3484.174.camel@ted>
Download mbox | patch
Permalink /patch/57823/
State New
Headers show


Richard Purdie - Sept. 11, 2013, 10:01 a.m.
BB_PRESERVE_ENV wasn't working since data.inheritFromOS wasn't getting a
correct list of keys to import into the data store. This fixes
things so it does add all environment variables into the data store
when BB_PRESERVE_ENV is used.

Signed-off-by: Richard Purdie <>


diff --git a/bitbake/lib/bb/ b/bitbake/lib/bb/
index 7686602..c96f460 100644
--- a/bitbake/lib/bb/
+++ b/bitbake/lib/bb/
@@ -532,6 +532,8 @@  def approved_variables():
     Determine and return the list of whitelisted variables which are approved
     to remain in the envrionment.
+    if 'BB_PRESERVE_ENV' in os.environ:
+        return os.environ.keys()
     approved = []
     if 'BB_ENV_WHITELIST' in os.environ:
         approved = os.environ['BB_ENV_WHITELIST'].split()