summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDongxiao Xu <dongxiao.xu@intel.com>2012-01-06 17:02:22 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-06 15:55:56 +0000
commitcf13bfe6612f450c62fe56b1d204fa747fa8bfd2 (patch)
tree7db0d71ab6a288dfbe915bf83ca7bb2ee697d770
parent7d7d3a0009a6d4e91b5696771cf1ae142af957fb (diff)
downloadpoky-cf13bfe6612f450c62fe56b1d204fa747fa8bfd2.tar.gz
poky-cf13bfe6612f450c62fe56b1d204fa747fa8bfd2.tar.bz2
poky-cf13bfe6612f450c62fe56b1d204fa747fa8bfd2.zip
command.py: add initCooker API
initCooker is to set the cooker to the initial state with nothing parsed. (Bitbake rev: 8ee9c6cc47938604268242d90bd3007218f9a36e) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/command.py6
-rw-r--r--bitbake/lib/bb/cooker.py13
2 files changed, 19 insertions, 0 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index 5dec6a9d09..701b286187 100644
--- a/bitbake/lib/bb/command.py
+++ b/bitbake/lib/bb/command.py
@@ -157,6 +157,12 @@ class CommandsSync:
value = params[1]
command.cooker.configuration.data.setVar(varname, value)
+ def initCooker(self, command, params):
+ """
+ Init the cooker to initial state with nothing parsed
+ """
+ command.cooker.initialize()
+
def resetCooker(self, command, params):
"""
Reset the cooker to its initial state, thus forcing a reparse for
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 6473839b30..1faf821aa5 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -167,6 +167,15 @@ class BBCooker:
self.parser = None
+ def initConfigurationData(self):
+ self.configuration.data = bb.data.init()
+
+ if not self.server_registration_cb:
+ bb.data.setVar("BB_WORKERCONTEXT", "1", self.configuration.data)
+
+ filtered_keys = bb.utils.approved_variables()
+ bb.data.inheritFromOS(self.configuration.data, self.savedenv, filtered_keys)
+
def loadConfigurationData(self):
self.configuration.data = bb.data.init()
@@ -1304,6 +1313,10 @@ class BBCooker:
def reparseFiles(self):
return
+ def initialize(self):
+ self.state = state.initial
+ self.initConfigurationData()
+
def reset(self):
self.state = state.initial
self.loadConfigurationData()