From patchwork Thu Sep 27 22:06:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [bitbake-devel] knotty: Allow displaying of status when no tasks are active Date: Thu, 27 Sep 2012 22:06:48 -0000 From: Richard Purdie X-Patchwork-Id: 37377 Message-Id: <1348783608.15753.31.camel@ted> To: bitbake-devel The console can appear to hang when no tasks are executing even if bitbake is iterating through a large number of tasks behind the scenes. This patch tweaks the footer code to display a status even when no tasks are active to give the user better feedback about what is happening. Signed-off-by: Richard Purdie --- diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index d81ad5d..1ec24d4 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py @@ -183,11 +183,11 @@ class TerminalFilter(object): activetasks = self.helper.running_tasks failedtasks = self.helper.failed_tasks runningpids = self.helper.running_pids - if self.footer_present and (self.lastpids == runningpids): + if self.footer_present and (self.lastcount == self.helper.tasknumber_current): return if self.footer_present: self.clearFooter() - if not activetasks: + if not self.helper.tasknumber_total or self.helper.tasknumber_current == self.helper.tasknumber_total: return tasks = [] for t in runningpids: @@ -195,6 +195,8 @@ class TerminalFilter(object): if self.main.shutdown: content = "Waiting for %s running tasks to finish:" % len(activetasks) + elif not len(activetasks): + content = "No currently running tasks (%s of %s)" % (self.helper.tasknumber_current, self.helper.tasknumber_total) else: content = "Currently %s running tasks (%s of %s):" % (len(activetasks), self.helper.tasknumber_current, self.helper.tasknumber_total) print content @@ -204,7 +206,7 @@ class TerminalFilter(object): print content lines = lines + 1 + int(len(content) / (self.columns + 1)) self.footer_present = lines - self.lastpids = runningpids[:] + self.lastcount = self.helper.tasknumber_current def finish(self): if self.stdinbackup: