diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-07-17 10:40:44 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-07-17 10:40:44 +0000 |
commit | 2fba213baa36179a0c677fb913aba593debfbe2a (patch) | |
tree | a634f5132ae2882a1221abf25f42f9485d125857 | |
parent | e71866de7ddcf66fcc28dcd3c518d9ec022a0406 (diff) | |
download | portage-2fba213baa36179a0c677fb913aba593debfbe2a.tar.gz portage-2fba213baa36179a0c677fb913aba593debfbe2a.tar.bz2 portage-2fba213baa36179a0c677fb913aba593debfbe2a.zip |
Tweak interaction between Scheduler and status display so that it doesn't
display more often than necessary and avoids showing inconsistent counts.
svn path=/main/trunk/; revision=11099
-rw-r--r-- | pym/_emerge/__init__.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index df4de0b7c..3fbca74b4 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -8984,7 +8984,6 @@ class Scheduler(PollScheduler): not merge.merge.pkg.installed: self._status_display.curval += 1 self._status_display.merges = len(self._task_queues.merge) - self._status_display.display() def _do_merge_exit(self, merge): pkg = merge.merge.pkg @@ -9021,13 +9020,13 @@ class Scheduler(PollScheduler): merge = PackageMerge(merge=build) merge.addExitListener(self._merge_exit) self._task_queues.merge.add(merge) + self._status_display.merges = len(self._task_queues.merge) else: self._failed_pkgs.append((build.pkg, build.returncode)) self._deallocate_config(build.settings) self._jobs -= 1 + self._status_display.running = self._jobs self._schedule() - self._status_display.merges = len(self._task_queues.merge) - self._status_display.display() def _extract_exit(self, build): self._build_exit(build) @@ -9135,8 +9134,8 @@ class Scheduler(PollScheduler): def _schedule_tasks(self): remaining, state_change = self._schedule_tasks_imp() - self._status_display.running = self._jobs - self._status_display.display() + if state_change: + self._status_display.display() return remaining def _schedule_tasks_imp(self): @@ -9177,10 +9176,12 @@ class Scheduler(PollScheduler): task_queues.merge.add(merge) elif pkg.built: self._jobs += 1 + self._status_display.running = self._jobs task.addExitListener(self._extract_exit) task_queues.jobs.add(task) else: self._jobs += 1 + self._status_display.running = self._jobs task.addExitListener(self._build_exit) task_queues.jobs.add(task) return (True, state_change) |