aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Schmaus <flow@gentoo.org>2024-06-18 11:27:55 +0200
committerJames Le Cuirot <chewi@gentoo.org>2024-08-02 14:34:57 +0100
commit6d1ee2c4f1ccd1bc783a6433a22166dbcfdd21e9 (patch)
tree7e86122cb42368500d3cd1eea90cd6c405d91c3b
parentemerge-webrsync: actually honour the sync-webrsync-verify-signature attribute (diff)
downloadportage-6d1ee2c4f1ccd1bc783a6433a22166dbcfdd21e9.tar.gz
portage-6d1ee2c4f1ccd1bc783a6433a22166dbcfdd21e9.tar.bz2
portage-6d1ee2c4f1ccd1bc783a6433a22166dbcfdd21e9.zip
JobStatusDisplay: show length of merge-wait queue
Since FEATURES=merge-wait is now the default, the length of the merge-wait queue becomes more relevant. Hence show it as part of portage's job status display. Signed-off-by: Florian Schmaus <flow@gentoo.org> Closes: https://github.com/gentoo/portage/pull/1347 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
-rw-r--r--NEWS1
-rw-r--r--lib/_emerge/JobStatusDisplay.py10
-rw-r--r--lib/_emerge/Scheduler.py3
3 files changed, 13 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index e8ba29df6..04ce6069d 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Features:
* emerge: Make bare --root-deps option install build-time dependencies to ROOT
as well as / for all EAPIs rather than instead of / for EAPI 6 and below
(bug #435066).
+* Show length of merge-wait queue as part of the status display
Bug fixes:
* ebuild: Handle Bash 5.2's change in behavior which enables the shopt
diff --git a/lib/_emerge/JobStatusDisplay.py b/lib/_emerge/JobStatusDisplay.py
index 9cf3c41db..f9e034c6e 100644
--- a/lib/_emerge/JobStatusDisplay.py
+++ b/lib/_emerge/JobStatusDisplay.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
import io
@@ -38,6 +38,7 @@ class JobStatusDisplay:
object.__setattr__(self, "quiet", quiet)
object.__setattr__(self, "xterm_titles", xterm_titles)
object.__setattr__(self, "maxval", 0)
+ object.__setattr__(self, "merge_wait", 0)
object.__setattr__(self, "merges", 0)
object.__setattr__(self, "_changed", False)
object.__setattr__(self, "_displayed", False)
@@ -262,6 +263,13 @@ class JobStatusDisplay:
f.pop_style()
f.add_literal_data(" failed")
+ if self.merge_wait:
+ f.add_literal_data(", ")
+ f.push_style(number_style)
+ f.add_literal_data(f"{self.merge_wait}")
+ f.pop_style()
+ f.add_literal_data(" merge wait")
+
padding = self._jobs_column_width - len(plain_output.getvalue())
if padding > 0:
f.add_literal_data(padding * " ")
diff --git a/lib/_emerge/Scheduler.py b/lib/_emerge/Scheduler.py
index e23ebeb7a..283144b55 100644
--- a/lib/_emerge/Scheduler.py
+++ b/lib/_emerge/Scheduler.py
@@ -1559,6 +1559,7 @@ class Scheduler(PollScheduler):
self._deallocate_config(build.settings)
self._jobs -= 1
self._status_display.running = self._jobs
+ self._status_display.merge_wait = len(self._merge_wait_queue)
self._schedule()
def _extract_exit(self, build):
@@ -1836,6 +1837,8 @@ class Scheduler(PollScheduler):
if task.is_system_pkg:
break
+ self._status_display.merge_wait = len(self._merge_wait_queue)
+
if self._schedule_tasks_imp():
state_change += 1