]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
knotty: fix task progress bar not starting at 0%
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Thu, 11 Aug 2016 03:36:58 +0000 (15:36 +1200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 17 Aug 2016 09:20:32 +0000 (10:20 +0100)
If we have the task number here we need to subtract 1 to get the number
of tasks completed.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/ui/knotty.py

index 1723a72a8dcbc38e6783426539f72b230b0356f1..f89f7b3c30f3a7b632946d70a480198f19ef8150 100644 (file)
@@ -260,13 +260,16 @@ class TerminalFilter(object):
                 content = "No currently running tasks (%s of %s)" % (self.helper.tasknumber_current, self.helper.tasknumber_total)
             else:
                 content = "Currently %2s running tasks (%s of %s)" % (len(activetasks), self.helper.tasknumber_current, self.helper.tasknumber_total)
-            maxtask = self.helper.tasknumber_total + 1
+            maxtask = self.helper.tasknumber_total
             if not self.main_progress or self.main_progress.maxval != maxtask:
                 widgets = [' ', progressbar.Percentage(), ' ', progressbar.Bar()]
                 self.main_progress = BBProgress("Running tasks", maxtask, widgets=widgets)
                 self.main_progress.start(False)
             self.main_progress.setmessage(content)
-            self.main_progress.update(self.helper.tasknumber_current)
+            progress = self.helper.tasknumber_current - 1
+            if progress < 0:
+                progress = 0
+            self.main_progress.update(progress)
             print('')
         lines = 1 + int(len(content) / (self.columns + 1))
         if not self.quiet: