aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/command.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-02 17:48:40 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-03 12:44:49 +0000
commitbae5210d7e048022f083361964ebec7daf1608f7 (patch)
tree99deb423473a42f7a9358bbd967958e5216b7526 /lib/bb/command.py
parentcd7f4d85e3f187140d1bb0aecf82f657a8f8701a (diff)
downloadbitbake-bae5210d7e048022f083361964ebec7daf1608f7.tar.gz
cooker/command/hob: Cleanup configuration init/reset functions and commands
initConfigurationData and loadConfigurationData are similar functions, the only reason for them appears to be to be able to reset the pre/post configuration files. The current code is confusing and unmaintainable. Instead this patch creates a new Sync command which allows these to be explicitly set. The init and load functions can then be merged into one. There is then no need for a parseConfiguration command, we can simply reset the server to have the settings take effect. The reset fuction is not an instant value return and triggers an event so it should be an Async command, not a sync one. The number of calls for the set pre/post command is probably higher than it need be but someone with more familiarity with the hob code base can probably figure out the right places its needed (maybe just init_cooker?). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/command.py')
-rw-r--r--lib/bb/command.py38
1 files changed, 14 insertions, 24 deletions
diff --git a/lib/bb/command.py b/lib/bb/command.py
index a2795ce0b..e30d21d37 100644
--- a/lib/bb/command.py
+++ b/lib/bb/command.py
@@ -196,18 +196,11 @@ class CommandsSync:
"""
command.cooker.disableDataTracking()
- 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
- any async command that has the needcache property set to True
- """
- command.cooker.reset()
+ def setPrePostConfFiles(self, command, params):
+ prefiles = params[0].split()
+ postfiles = params[1].split()
+ command.cooker.configuration.prefile = prefiles
+ command.cooker.configuration.postfile = postfiles
def getCpuCount(self, command, params):
"""
@@ -420,18 +413,6 @@ class CommandsAsync:
command.finishAsyncCommand()
compareRevisions.needcache = True
- def parseConfigurationFiles(self, command, params):
- """
- Parse the configuration files
- """
- prefiles = params[0].split()
- postfiles = params[1].split()
- command.cooker.configuration.prefile = prefiles
- command.cooker.configuration.postfile = postfiles
- command.cooker.loadConfigurationData()
- command.finishAsyncCommand()
- parseConfigurationFiles.needcache = False
-
def triggerEvent(self, command, params):
"""
Trigger a certain event
@@ -441,3 +422,12 @@ class CommandsAsync:
command.currentAsyncCommand = None
triggerEvent.needcache = False
+ def resetCooker(self, command, params):
+ """
+ Reset the cooker to its initial state, thus forcing a reparse for
+ any async command that has the needcache property set to True
+ """
+ command.cooker.reset()
+ command.finishAsyncCommand()
+ resetCooker.needcache = False
+