From 53ff069611e9b22d94ff1406cfa223564b7e54a6 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 25 Aug 2010 00:58:23 +0100 Subject: bitbake/runqueue.py: Ensure rqexe always exists and that empty task lists cause a graceful exit Signed-off-by: Richard Purdie --- bitbake/lib/bb/runqueue.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index ef5256f14c..1b974312b2 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py @@ -360,7 +360,7 @@ class RunQueueData: if len(taskData.tasks_name) == 0: # Nothing to do - return + return 0 bb.msg.note(1, bb.msg.domain.RunQueue, "Preparing runqueue") @@ -686,6 +686,8 @@ class RunQueueData: #bb.note("Found setscene for %s %s" % (self.taskData.fn_index[self.runq_fnid[task]], self.runq_task[task])) self.runq_setscene.append(task) + return len(self.runq_fnid) + def dump_data(self, taskQueue): """ Dump some debug information on the internal data structures @@ -876,8 +878,11 @@ class RunQueue: retval = 0.5 if self.state is runQueuePrepare: - self.rqdata.prepare() - self.state = runQueueSceneInit + self.rqexe = RunQueueExecuteDummy(self) + if self.rqdata.prepare() is 0: + self.state = runQueueComplete + else: + self.state = runQueueSceneInit if self.state is runQueueSceneInit: self.rqexe = RunQueueExecuteScenequeue(self) @@ -1014,6 +1019,14 @@ class RunQueueExecute: return proc +class RunQueueExecuteDummy(RunQueueExecute): + def __init__(self, rq): + self.rq = rq + self.stats = RunQueueStats(0) + def finish(self): + self.rq.state = runQueueComplete + return + class RunQueueExecuteTasks(RunQueueExecute): def __init__(self, rq): RunQueueExecute.__init__(self, rq) -- cgit v1.2.3