[oe-commits] [bitbake] 09/12: knotty: fix task progress bar not starting at 0%

git at git.openembedded.org git at git.openembedded.org
Tue Aug 16 19:54:00 UTC 2016


rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 7b47f82446553f2d6d7212c127474a4be46ff8f0
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Thu Aug 11 15:36:58 2016 +1200

    knotty: fix task progress bar not starting at 0%
    
    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 at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/ui/knotty.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py
index 1723a72..f89f7b3 100644
--- a/lib/bb/ui/knotty.py
+++ b/lib/bb/ui/knotty.py
@@ -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:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list