]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: knotty: Allow displaying of status when no tasks are active
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 27 Sep 2012 21:56:02 +0000 (21:56 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 28 Sep 2012 10:15:05 +0000 (11:15 +0100)
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.

(Bitbake rev: 0a950ee14fce3a0cb938c22d7c717dc93ce6e25f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/ui/knotty.py

index d81ad5d540264b75f5ea98438deabe6101721574..3799018fe301e5b05716ec65359a3a1b7c307ab2 100644 (file)
@@ -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) and (self.lastpids == runningpids):
             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
@@ -205,6 +207,7 @@ class TerminalFilter(object):
             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: