diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-09-23 21:14:32 +1200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-23 15:01:56 +0100 |
commit | 9173b11f2f76797c3ee8b1e2ebed21c550323136 (patch) | |
tree | ce38f3ca6df9c216e5af797fac9e40dea6c31014 /bitbake/lib/bb/ui/knotty.py | |
parent | 0d76de85bd2fa8fc6b0a3a5a65f2817a5d0b2186 (diff) | |
download | poky-9173b11f2f76797c3ee8b1e2ebed21c550323136.tar.gz |
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>
Diffstat (limited to 'bitbake/lib/bb/ui/knotty.py')
-rw-r--r-- | 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 79325bb6e4..b31a8a18e1 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
@@ -280,7 +280,7 @@ class TerminalFilter(object): | |||
280 | progress = self.helper.tasknumber_current - 1 | 280 | progress = self.helper.tasknumber_current - 1 |
281 | if progress < 0: | 281 | if progress < 0: |
282 | progress = 0 | 282 | progress = 0 |
283 | self.main_progress.update(progress) | 283 | content = self.main_progress.update(progress) |
284 | print('') | 284 | print('') |
285 | lines = 1 + int(len(content) / (self.columns + 1)) | 285 | lines = 1 + int(len(content) / (self.columns + 1)) |
286 | if not self.quiet: | 286 | if not self.quiet: |
@@ -294,11 +294,10 @@ class TerminalFilter(object): | |||
294 | pbar.setmessage('%s:%s' % (tasknum, pbar.msg.split(':', 1)[1])) | 294 | pbar.setmessage('%s:%s' % (tasknum, pbar.msg.split(':', 1)[1])) |
295 | if progress > -1: | 295 | if progress > -1: |
296 | pbar.setextra(rate) | 296 | pbar.setextra(rate) |
297 | output = pbar.update(progress) | 297 | content = pbar.update(progress) |
298 | else: | 298 | else: |
299 | output = pbar.update(1) | 299 | content = pbar.update(1) |
300 | if not output or (len(output) <= pbar.term_width): | 300 | print('') |
301 | print('') | ||
302 | else: | 301 | else: |
303 | content = "%s: %s" % (tasknum, task) | 302 | content = "%s: %s" % (tasknum, task) |
304 | print(content) | 303 | print(content) |