[gnome-continuous-yocto/gnomeostree-3.28-rocko: 2610/8267] bitbake: knotty: ensure progress bar output is accounted for in display



commit 9173b11f2f76797c3ee8b1e2ebed21c550323136
Author: Paul Eggleton <paul eggleton linux intel com>
Date:   Fri Sep 23 21:14:32 2016 +1200

    bitbake: knotty: ensure progress bar output is accounted for in display
    
    When calculating how many lines we'd printed we weren't properly taking
    the progress bars into account, with the result that sometimes if the
    last line printed on the terminal wrapped to the next line (which is
    possible) we backed up less lines than we should have.
    
    Additionally, we should always print a newline after updating the
    progress bar - there's no need to check if there wasn't output (there
    always will be courtesy of our overridden _need_update()) and we now
    allow the line to wrap so we don't need to check the other condition
    either.
    
    Hopefully this will fix [YOCTO #10046].
    
    (Bitbake rev: 326d18d96faf02675ba34ad3c3a20cd424b39b91)
    
    Signed-off-by: Paul Eggleton <paul eggleton linux intel com>
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 bitbake/lib/bb/ui/knotty.py |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 79325bb..b31a8a1 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -280,7 +280,7 @@ class TerminalFilter(object):
             progress = self.helper.tasknumber_current - 1
             if progress < 0:
                 progress = 0
-            self.main_progress.update(progress)
+            content = self.main_progress.update(progress)
             print('')
         lines = 1 + int(len(content) / (self.columns + 1))
         if not self.quiet:
@@ -294,11 +294,10 @@ class TerminalFilter(object):
                     pbar.setmessage('%s:%s' % (tasknum, pbar.msg.split(':', 1)[1]))
                     if progress > -1:
                         pbar.setextra(rate)
-                        output = pbar.update(progress)
+                        content = pbar.update(progress)
                     else:
-                        output = pbar.update(1)
-                    if not output or (len(output) <= pbar.term_width):
-                        print('')
+                        content = pbar.update(1)
+                    print('')
                 else:
                     content = "%s: %s" % (tasknum, task)
                     print(content)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]