diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-07-03 17:36:19 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-07-15 10:28:12 +0100 |
commit | b4c6a2d059c3341e0ea21e6edab7a6d906b85f0a (patch) | |
tree | 9d92658b2699a175a19bbecae3ea0a44bf0571e8 /bitbake/lib/bb/runqueue.py | |
parent | d3d7163ab608b7264f1b8bcbc37d845b292be3b6 (diff) | |
download | openembedded-core-contrib-b4c6a2d059c3341e0ea21e6edab7a6d906b85f0a.tar.gz |
bitbake: runqueue: Simplify _execute_runqueue logic
Cleanup to the _execute_runqueue logic to reduce indentation, drop the
dummy executor class concept and prepare for further changes.
(Bitbake rev: 726e3c61a69fef16e605ba9b911a17cd99f1a2c3)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 517684c3ff..2cfcb33cca 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py @@ -1420,15 +1420,16 @@ class RunQueue: self.state = runQueueComplete else: self.state = runQueueSceneInit - self.rqdata.init_progress_reporter.next_stage() - - # we are ready to run, emit dependency info to any UI or class which - # needs it - depgraph = self.cooker.buildDependTree(self, self.rqdata.taskData) - self.rqdata.init_progress_reporter.next_stage() - bb.event.fire(bb.event.DepTreeGenerated(depgraph), self.cooker.data) if self.state is runQueueSceneInit: + self.rqdata.init_progress_reporter.next_stage() + + # we are ready to run, emit dependency info to any UI or class which + # needs it + depgraph = self.cooker.buildDependTree(self, self.rqdata.taskData) + self.rqdata.init_progress_reporter.next_stage() + bb.event.fire(bb.event.DepTreeGenerated(depgraph), self.cooker.data) + if not self.dm_event_handler_registered: res = bb.event.register(self.dm_event_handler_name, lambda x: self.dm.check(self) if self.state in [runQueueSceneRun, runQueueRunning, runQueueCleanUp] else False, @@ -1444,13 +1445,13 @@ class RunQueue: if 'printdiff' in dump: self.write_diffscenetasks(invalidtasks) self.state = runQueueComplete - else: - self.rqdata.init_progress_reporter.next_stage() - self.start_worker() - self.rqdata.init_progress_reporter.next_stage() - if not self.rqexe: - self.rqexe = RunQueueExecute(self) - start_scenequeue_tasks(self.rqexe) + + if self.state is runQueueSceneInit: + self.rqdata.init_progress_reporter.next_stage() + self.start_worker() + self.rqdata.init_progress_reporter.next_stage() + self.rqexe = RunQueueExecute(self) + start_scenequeue_tasks(self.rqexe) if self.state is runQueueSceneRun: retval = self.rqexe.sq_execute() @@ -1458,14 +1459,15 @@ class RunQueue: if self.state is runQueueRunInit: if self.cooker.configuration.setsceneonly: self.state = runQueueComplete - else: - # Just in case we didn't setscene - self.rqdata.init_progress_reporter.finish() - logger.info("Executing RunQueue Tasks") - if not self.rqexe: - self.rqexe = RunQueueExecute(self) - start_runqueue_tasks(self.rqexe) - self.state = runQueueRunning + + if self.state is runQueueRunInit: + # Just in case we didn't setscene + self.rqdata.init_progress_reporter.finish() + logger.info("Executing RunQueue Tasks") + if not self.rqexe: + self.rqexe = RunQueueExecute(self) + start_runqueue_tasks(self.rqexe) + self.state = runQueueRunning if self.state is runQueueRunning: retval = self.rqexe.execute() |