[oe-commits] [bitbake] 10/22: runqueue: Simplify _execute_runqueue logic
git at git.openembedded.org
git at git.openembedded.org
Sat Jul 6 16:13:26 UTC 2019
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository bitbake.
commit 6c1322d756814b18f87dbb7fa875a525b7357e6d
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Wed Jul 3 17:36:19 2019 +0100
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.
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/bb/runqueue.py | 47 +++++++++++++++++++++++++----------------------
1 file changed, 25 insertions(+), 22 deletions(-)
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index a730b94..e7e1e38 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -1419,15 +1419,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,
@@ -1443,13 +1444,14 @@ 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()
+ if not self.rqexe:
+ self.rqexe = RunQueueExecute(self)
+ start_scenequeue_tasks(self.rqexe)
if self.state is runQueueSceneRun:
retval = self.rqexe.sq_execute()
@@ -1457,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()
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list