summaryrefslogtreecommitdiffstats
path: root/lib/bb/cooker.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-01-21 10:49:01 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-01-21 11:35:58 +0000
commit4d1343010da757a0c126bc22475354da44aaf8e3 (patch)
treeb1ed47ced02b78db1698d07b4d61993f7f4b0d31 /lib/bb/cooker.py
parentb4d40f1ac7b32990c456cce261f99a5a157b5ae5 (diff)
downloadopenembedded-core-contrib-4d1343010da757a0c126bc22475354da44aaf8e3.tar.gz
command/cooker/knotty: Fix memres handling of command environment changes
If the environment changes, we need memory resident bitbake to adapt to those changes. This adds in functionality to handle this alongside the configuration option handling code. This means that the common usage: MACHINE=X bitbake Y now works with the memory resident server. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/cooker.py')
-rw-r--r--lib/bb/cooker.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 95f65ac685..9086f92e5c 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -489,9 +489,29 @@ class BBCooker:
self.handleCollections( self.data.getVar("BBFILE_COLLECTIONS", True) )
- def updateConfigOpts(self,options):
+ def updateConfigOpts(self, options, environment):
for o in options:
setattr(self.configuration, o, options[o])
+ clean = True
+ for k in bb.utils.approved_variables():
+ if k in environment and k not in self.configuration.env:
+ logger.debug(1, "Updating environment variable %s to %s" % (k, environment[k]))
+ self.configuration.env[k] = environment[k]
+ clean = False
+ if k in self.configuration.env and k not in environment:
+ logger.debug(1, "Updating environment variable %s (deleted)" % (k))
+ del self.configuration.env[k]
+ clean = False
+ if k not in self.configuration.env and k not in environment:
+ continue
+ if environment[k] != self.configuration.env[k]:
+ logger.debug(1, "Updating environment variable %s to %s" % (k, environment[k]))
+ self.configuration.env[k] = environment[k]
+ clean = False
+ if not clean:
+ logger.debug(1, "Base environment change, triggering reparse")
+ self.baseconfig_valid = False
+ self.reset()
def runCommands(self, server, data, abort):
"""