All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: bitbake-devel@lists.openembedded.org
Subject: [PATCH 04/10] command.py: add initCooker API
Date: Thu, 15 Dec 2011 15:14:55 +0800	[thread overview]
Message-ID: <9b438bb7b3c614151cf2026f16bd62177083e0c5.1323933009.git.dongxiao.xu@intel.com> (raw)
In-Reply-To: <cover.1323933009.git.dongxiao.xu@intel.com>
In-Reply-To: <cover.1323933009.git.dongxiao.xu@intel.com>

initCooker is to set the cooker to the initial state with nothing
parsed.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 lib/bb/command.py |    6 ++++++
 lib/bb/cooker.py  |   13 +++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/lib/bb/command.py b/lib/bb/command.py
index 5dec6a9..701b286 100644
--- a/lib/bb/command.py
+++ b/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/lib/bb/cooker.py b/lib/bb/cooker.py
index 6ddb38e..666242f 100644
--- a/lib/bb/cooker.py
+++ b/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()
 
@@ -1301,6 +1310,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()
-- 
1.7.0.4




  parent reply	other threads:[~2011-12-15  7:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-15  7:14 [PATCH 00/10 v2] Hob2 related bitbake changes Dongxiao Xu
2011-12-15  7:14 ` [PATCH 01/10] command.py: Modify needcache value for certain functions Dongxiao Xu
2011-12-15  7:14 ` [PATCH 02/10] cache: Use configuration's hash value to validate cache Dongxiao Xu
2011-12-15  7:14 ` [PATCH 03/10] cooker: user bb.configuration.data to inject events Dongxiao Xu
2011-12-15  7:14 ` Dongxiao Xu [this message]
2011-12-15  7:14 ` [PATCH 05/10] command.py: add parseConfigurationFiles API Dongxiao Xu
2011-12-15  7:14 ` [PATCH 06/10] command.py: add resolve option for generateTargetsTree API Dongxiao Xu
2011-12-15  7:14 ` [PATCH 07/10] event.py: Add a new event PackageInfo Dongxiao Xu
2011-12-15  7:14 ` [PATCH 08/10] xmlrpc: Change BitbakeServerInfo init function Dongxiao Xu
2011-12-15  7:15 ` [PATCH 09/10] cooker: remove command import in cooker.py Dongxiao Xu
2011-12-15  7:15 ` [PATCH 10/10] bitbake: add a new option "--server-only" Dongxiao Xu
2011-12-19 11:00 ` [PATCH 00/10 v2] Hob2 related bitbake changes Xu, Dongxiao
  -- strict thread matches above, loose matches on Subject: below --
2011-12-12  2:20 [PATCH 00/10][PULL] " Dongxiao Xu
2011-12-12  2:20 ` [PATCH 04/10] command.py: add initCooker API Dongxiao Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9b438bb7b3c614151cf2026f16bd62177083e0c5.1323933009.git.dongxiao.xu@intel.com \
    --to=dongxiao.xu@intel.com \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.