diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-27 21:56:02 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-28 11:15:05 +0100 |
commit | 49649451cbe6ac3999aa337c4d9c2c622b76c178 (patch) | |
tree | 5cc83e674602fb67005d59bdbda79cf2f309d283 /bitbake | |
parent | b85c30bb7d47dd8e9bea0e11029c0b08466603b0 (diff) | |
download | poky-49649451cbe6ac3999aa337c4d9c2c622b76c178.tar.gz |
bitbake: knotty: Allow displaying of status when no tasks are active
The console can appear to hang when no tasks are executing even if bitbake
is iterating through a large number of tasks behind the scenes.
This patch tweaks the footer code to display a status even when no tasks
are active to give the user better feedback about what is happening.
(Bitbake rev: 0a950ee14fce3a0cb938c22d7c717dc93ce6e25f)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index d81ad5d540..3799018fe3 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
@@ -183,11 +183,11 @@ class TerminalFilter(object): | |||
183 | activetasks = self.helper.running_tasks | 183 | activetasks = self.helper.running_tasks |
184 | failedtasks = self.helper.failed_tasks | 184 | failedtasks = self.helper.failed_tasks |
185 | runningpids = self.helper.running_pids | 185 | runningpids = self.helper.running_pids |
186 | if self.footer_present and (self.lastpids == runningpids): | 186 | if self.footer_present and (self.lastcount == self.helper.tasknumber_current) and (self.lastpids == runningpids): |
187 | return | 187 | return |
188 | if self.footer_present: | 188 | if self.footer_present: |
189 | self.clearFooter() | 189 | self.clearFooter() |
190 | if not activetasks: | 190 | if not self.helper.tasknumber_total or self.helper.tasknumber_current == self.helper.tasknumber_total: |
191 | return | 191 | return |
192 | tasks = [] | 192 | tasks = [] |
193 | for t in runningpids: | 193 | for t in runningpids: |
@@ -195,6 +195,8 @@ class TerminalFilter(object): | |||
195 | 195 | ||
196 | if self.main.shutdown: | 196 | if self.main.shutdown: |
197 | content = "Waiting for %s running tasks to finish:" % len(activetasks) | 197 | content = "Waiting for %s running tasks to finish:" % len(activetasks) |
198 | elif not len(activetasks): | ||
199 | content = "No currently running tasks (%s of %s)" % (self.helper.tasknumber_current, self.helper.tasknumber_total) | ||
198 | else: | 200 | else: |
199 | content = "Currently %s running tasks (%s of %s):" % (len(activetasks), self.helper.tasknumber_current, self.helper.tasknumber_total) | 201 | content = "Currently %s running tasks (%s of %s):" % (len(activetasks), self.helper.tasknumber_current, self.helper.tasknumber_total) |
200 | print content | 202 | print content |
@@ -205,6 +207,7 @@ class TerminalFilter(object): | |||
205 | lines = lines + 1 + int(len(content) / (self.columns + 1)) | 207 | lines = lines + 1 + int(len(content) / (self.columns + 1)) |
206 | self.footer_present = lines | 208 | self.footer_present = lines |
207 | self.lastpids = runningpids[:] | 209 | self.lastpids = runningpids[:] |
210 | self.lastcount = self.helper.tasknumber_current | ||
208 | 211 | ||
209 | def finish(self): | 212 | def finish(self): |
210 | if self.stdinbackup: | 213 | if self.stdinbackup: |