diff options
author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2022-03-08 15:32:32 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-11 06:56:01 +0000 |
commit | aae4f55d1b55764d5919174add728d15a33641f1 (patch) | |
tree | 8a7cdf845141cf4e1d07c246922067c337950888 /bitbake | |
parent | af7a4af979684234607b0fbacc92e0cfdd6e268e (diff) | |
download | poky-aae4f55d1b55764d5919174add728d15a33641f1.tar.gz |
bitbake: knotty.py: A little clean up of TerminalFilter::updateFooter()
* Use max() to clamp progress to >= 0.
* Be consistent when evaluating self.quiet (treat it as a boolean).
(Bitbake rev: 160f71372ff93894d9314619e9d3b547c1f3cda3)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 52e6eb96fe..78888f8bdd 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
@@ -299,13 +299,11 @@ class TerminalFilter(object): | |||
299 | self.main_progress = BBProgress("Running tasks", maxtask, widgets=widgets, resize_handler=self.sigwinch_handle) | 299 | self.main_progress = BBProgress("Running tasks", maxtask, widgets=widgets, resize_handler=self.sigwinch_handle) |
300 | self.main_progress.start(False) | 300 | self.main_progress.start(False) |
301 | self.main_progress.setmessage(msg) | 301 | self.main_progress.setmessage(msg) |
302 | progress = self.helper.tasknumber_current - 1 | 302 | progress = max(0, self.helper.tasknumber_current - 1) |
303 | if progress < 0: | ||
304 | progress = 0 | ||
305 | content += self.main_progress.update(progress) | 303 | content += self.main_progress.update(progress) |
306 | print('') | 304 | print('') |
307 | lines = self.getlines(content) | 305 | lines = self.getlines(content) |
308 | if self.quiet == 0: | 306 | if not self.quiet: |
309 | for tasknum, task in enumerate(tasks[:(self.rows - 1 - lines)]): | 307 | for tasknum, task in enumerate(tasks[:(self.rows - 1 - lines)]): |
310 | if isinstance(task, tuple): | 308 | if isinstance(task, tuple): |
311 | pbar, progress, rate, start_time = task | 309 | pbar, progress, rate, start_time = task |