summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-03 17:36:19 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-15 10:28:12 +0100
commitb4c6a2d059c3341e0ea21e6edab7a6d906b85f0a (patch)
tree9d92658b2699a175a19bbecae3ea0a44bf0571e8 /bitbake
parentd3d7163ab608b7264f1b8bcbc37d845b292be3b6 (diff)
downloadpoky-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')
-rw-r--r--bitbake/lib/bb/runqueue.py46
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:
1420 self.state = runQueueComplete 1420 self.state = runQueueComplete
1421 else: 1421 else:
1422 self.state = runQueueSceneInit 1422 self.state = runQueueSceneInit
1423 self.rqdata.init_progress_reporter.next_stage()
1424
1425 # we are ready to run, emit dependency info to any UI or class which
1426 # needs it
1427 depgraph = self.cooker.buildDependTree(self, self.rqdata.taskData)
1428 self.rqdata.init_progress_reporter.next_stage()
1429 bb.event.fire(bb.event.DepTreeGenerated(depgraph), self.cooker.data)
1430 1423
1431 if self.state is runQueueSceneInit: 1424 if self.state is runQueueSceneInit:
1425 self.rqdata.init_progress_reporter.next_stage()
1426
1427 # we are ready to run, emit dependency info to any UI or class which
1428 # needs it
1429 depgraph = self.cooker.buildDependTree(self, self.rqdata.taskData)
1430 self.rqdata.init_progress_reporter.next_stage()
1431 bb.event.fire(bb.event.DepTreeGenerated(depgraph), self.cooker.data)
1432
1432 if not self.dm_event_handler_registered: 1433 if not self.dm_event_handler_registered:
1433 res = bb.event.register(self.dm_event_handler_name, 1434 res = bb.event.register(self.dm_event_handler_name,
1434 lambda x: self.dm.check(self) if self.state in [runQueueSceneRun, runQueueRunning, runQueueCleanUp] else False, 1435 lambda x: self.dm.check(self) if self.state in [runQueueSceneRun, runQueueRunning, runQueueCleanUp] else False,
@@ -1444,13 +1445,13 @@ class RunQueue:
1444 if 'printdiff' in dump: 1445 if 'printdiff' in dump:
1445 self.write_diffscenetasks(invalidtasks) 1446 self.write_diffscenetasks(invalidtasks)
1446 self.state = runQueueComplete 1447 self.state = runQueueComplete
1447 else: 1448
1448 self.rqdata.init_progress_reporter.next_stage() 1449 if self.state is runQueueSceneInit:
1449 self.start_worker() 1450 self.rqdata.init_progress_reporter.next_stage()
1450 self.rqdata.init_progress_reporter.next_stage() 1451 self.start_worker()
1451 if not self.rqexe: 1452 self.rqdata.init_progress_reporter.next_stage()
1452 self.rqexe = RunQueueExecute(self) 1453 self.rqexe = RunQueueExecute(self)
1453 start_scenequeue_tasks(self.rqexe) 1454 start_scenequeue_tasks(self.rqexe)
1454 1455
1455 if self.state is runQueueSceneRun: 1456 if self.state is runQueueSceneRun:
1456 retval = self.rqexe.sq_execute() 1457 retval = self.rqexe.sq_execute()
@@ -1458,14 +1459,15 @@ class RunQueue:
1458 if self.state is runQueueRunInit: 1459 if self.state is runQueueRunInit:
1459 if self.cooker.configuration.setsceneonly: 1460 if self.cooker.configuration.setsceneonly:
1460 self.state = runQueueComplete 1461 self.state = runQueueComplete
1461 else: 1462
1462 # Just in case we didn't setscene 1463 if self.state is runQueueRunInit:
1463 self.rqdata.init_progress_reporter.finish() 1464 # Just in case we didn't setscene
1464 logger.info("Executing RunQueue Tasks") 1465 self.rqdata.init_progress_reporter.finish()
1465 if not self.rqexe: 1466 logger.info("Executing RunQueue Tasks")
1466 self.rqexe = RunQueueExecute(self) 1467 if not self.rqexe:
1467 start_runqueue_tasks(self.rqexe) 1468 self.rqexe = RunQueueExecute(self)
1468 self.state = runQueueRunning 1469 start_runqueue_tasks(self.rqexe)
1470 self.state = runQueueRunning
1469 1471
1470 if self.state is runQueueRunning: 1472 if self.state is runQueueRunning:
1471 retval = self.rqexe.execute() 1473 retval = self.rqexe.execute()