summaryrefslogtreecommitdiffstats
path: root/bitbake/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 17:45:54 +0000
commitd1e66643ae2e379f5e51ab9370ef8cb7e66dcb35 (patch)
tree2e129b3f58109ba30d1b8ce757f6adbe979e2601 /bitbake/lib/bb/command.py
parentb8f0963592aa6a9ebd679fa363ca6f894b132d75 (diff)
downloadpoky-d1e66643ae2e379f5e51ab9370ef8cb7e66dcb35.tar.gz
bitbake: 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?). (Bitbake rev: bae5210d7e048022f083361964ebec7daf1608f7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/command.py')
-rw-r--r--bitbake/lib/bb/command.py38
1 files changed, 14 insertions, 24 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index a2795ce0b7..e30d21d379 100644
--- a/bitbake/lib/bb/command.py
+++ b/bitbake/lib/bb/command.py
@@ -196,18 +196,11 @@ class CommandsSync:
196 """ 196 """
197 command.cooker.disableDataTracking() 197 command.cooker.disableDataTracking()
198 198
199 def initCooker(self, command, params): 199 def setPrePostConfFiles(self, command, params):
200 """ 200 prefiles = params[0].split()
201 Init the cooker to initial state with nothing parsed 201 postfiles = params[1].split()
202 """ 202 command.cooker.configuration.prefile = prefiles
203 command.cooker.initialize() 203 command.cooker.configuration.postfile = postfiles
204
205 def resetCooker(self, command, params):
206 """
207 Reset the cooker to its initial state, thus forcing a reparse for
208 any async command that has the needcache property set to True
209 """
210 command.cooker.reset()
211 204
212 def getCpuCount(self, command, params): 205 def getCpuCount(self, command, params):
213 """ 206 """
@@ -420,18 +413,6 @@ class CommandsAsync:
420 command.finishAsyncCommand() 413 command.finishAsyncCommand()
421 compareRevisions.needcache = True 414 compareRevisions.needcache = True
422 415
423 def parseConfigurationFiles(self, command, params):
424 """
425 Parse the configuration files
426 """
427 prefiles = params[0].split()
428 postfiles = params[1].split()
429 command.cooker.configuration.prefile = prefiles
430 command.cooker.configuration.postfile = postfiles
431 command.cooker.loadConfigurationData()
432 command.finishAsyncCommand()
433 parseConfigurationFiles.needcache = False
434
435 def triggerEvent(self, command, params): 416 def triggerEvent(self, command, params):
436 """ 417 """
437 Trigger a certain event 418 Trigger a certain event
@@ -441,3 +422,12 @@ class CommandsAsync:
441 command.currentAsyncCommand = None 422 command.currentAsyncCommand = None
442 triggerEvent.needcache = False 423 triggerEvent.needcache = False
443 424
425 def resetCooker(self, command, params):
426 """
427 Reset the cooker to its initial state, thus forcing a reparse for
428 any async command that has the needcache property set to True
429 """
430 command.cooker.reset()
431 command.finishAsyncCommand()
432 resetCooker.needcache = False
433