public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: /, lib/_emerge/
@ 2022-11-23 23:02 Sam James
  0 siblings, 0 replies; 9+ messages in thread
From: Sam James @ 2022-11-23 23:02 UTC (permalink / raw
  To: gentoo-commits

commit:     fca3478de7127bbdf58c6f4b809c177662d5e4cb
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 20 11:46:34 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Nov 23 23:01:57 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=fca3478d

depgraph: Resolve atoms using the correct root

This bug may have played out in different ways, but one example was a
rebuild in / causing the same package to be added to ROOT, even when it
had no other reason to be.

Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/941
Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                    |  4 ++++
 lib/_emerge/depgraph.py | 14 ++++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 1426a0856..8767d393c 100644
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,10 @@ Bug fixes:
   by the SYSROOT location. For example, if BROOT=/foo, ROOT=/bar, EPREFIX=/baz,
   EROOT=/bar/baz, and SYSROOT=/ then ESYSROOT should be /foo, not /baz.
 
+* depgraph: Resolve atoms using the correct root. This bug may have played out
+  in different ways, but one example was a rebuild in / causing the same package
+  to be added to ROOT, even when it had no other reason to be.
+
 portage-3.0.39 (2022-11-20)
 --------------
 

diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index c976f8205..e556d6616 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -5019,13 +5019,14 @@ class depgraph:
         a favorite list."""
         debug = "--debug" in self._frozen_config.myopts
         onlydeps = "--onlydeps" in self._frozen_config.myopts
-        myroot = self._frozen_config.target_root
-        pkgsettings = self._frozen_config.pkgsettings[myroot]
-        pprovideddict = pkgsettings.pprovideddict
-        virtuals = pkgsettings.getvirtuals()
         args = self._dynamic_config._initial_arg_list[:]
 
         for arg in self._expand_set_args(args, add_to_digraph=True):
+            myroot = arg.root_config.root
+            pkgsettings = self._frozen_config.pkgsettings[myroot]
+            pprovideddict = pkgsettings.pprovideddict
+            virtuals = pkgsettings.getvirtuals()
+
             for atom in sorted(arg.pset.getAtoms()):
                 self._spinner_update()
                 dep = Dependency(atom=atom, onlydeps=onlydeps, root=myroot, parent=arg)
@@ -5169,6 +5170,11 @@ class depgraph:
                     )
                     raise
 
+        try:
+            del myroot, pkgsettings, pprovideddict, virtuals
+        except NameError:
+            pass
+
         # Now that the root packages have been added to the graph,
         # process the dependencies.
         if not self._create_graph():


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage:master commit in: /, lib/_emerge/
@ 2023-01-10  3:28 Sam James
  0 siblings, 0 replies; 9+ messages in thread
From: Sam James @ 2023-01-10  3:28 UTC (permalink / raw
  To: gentoo-commits

commit:     7b47c30537c58c6c9a25b18959c58de85067634d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jan  5 15:26:41 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jan 10 03:28:46 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7b47c305

depgraph: Print dependency resolution time

Print the wall clock time it took emerge to calculate the dependency
graph if spinner is used (i.e. we're in verbose mode).

Requested-by: Maciej Barć <xgqt <AT> gentoo.org>
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/972
Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                          | 4 ++++
 lib/_emerge/depgraph.py       | 6 ++++++
 lib/_emerge/stdout_spinner.py | 1 +
 3 files changed, 11 insertions(+)

diff --git a/NEWS b/NEWS
index d143765b1..23a652278 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,10 @@
 portage-3.0.44 (UNRELEASED)
 --------------
 
+Features:
+* emerge: Show time taken to calculate dependency resolution with
+  emerge --verbose.
+
 Bug fixes:
 * ebuild: the PATH variable exported to ebuilds has been changed:
   The PATH setting from /etc/profile.env is appended to portage-internal

diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index 4d7a96a2d..15dcfbc84 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -6,6 +6,7 @@ import functools
 import logging
 import stat
 import textwrap
+import time
 import warnings
 import collections
 from collections import deque, OrderedDict
@@ -11522,6 +11523,7 @@ def _spinner_start(spinner, myopts):
 
     if show_spinner:
         portage.writemsg_stdout("Calculating dependencies  ")
+    spinner.start_time = time.time()
 
 
 def _spinner_stop(spinner):
@@ -11535,6 +11537,10 @@ def _spinner_stop(spinner):
 
     portage.writemsg_stdout("... done!\n")
 
+    stop_time = time.time()
+    time_fmt = f"{stop_time - spinner.start_time:.2f}"
+    portage.writemsg_stdout(f"Dependency resolution took {darkgreen(time_fmt)} s.\n\n")
+
 
 def backtrack_depgraph(settings, trees, myopts, myparams, myaction, myfiles, spinner):
     """

diff --git a/lib/_emerge/stdout_spinner.py b/lib/_emerge/stdout_spinner.py
index b28977e66..d4c1db59b 100644
--- a/lib/_emerge/stdout_spinner.py
+++ b/lib/_emerge/stdout_spinner.py
@@ -39,6 +39,7 @@ class stdout_spinner:
         ]
         self.last_update = 0
         self.min_display_latency = 0.05
+        self.start_time = None
 
     def _return_early(self):
         """


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage:master commit in: /, lib/_emerge/
@ 2023-01-10  3:28 Sam James
  0 siblings, 0 replies; 9+ messages in thread
From: Sam James @ 2023-01-10  3:28 UTC (permalink / raw
  To: gentoo-commits

commit:     a0ca453907f461d0bed987cfe7ce52520b2d59ef
Author:     Sheng Yu <syu.os <AT> protonmail <DOT> com>
AuthorDate: Tue Jan 10 03:03:40 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jan 10 03:28:03 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a0ca4539

emerge: depgraph: Correctly detect installation from path for binpkgs

Bug: https://bugs.gentoo.org/873202
Bug: https://bugs.gentoo.org/890291
Signed-off-by: Sheng Yu <syu.os <AT> protonmail.com>
Closes: https://github.com/gentoo/portage/pull/973
Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                    |  5 ++++-
 lib/_emerge/depgraph.py | 14 +++++++++++---
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 3821e6fcf..d143765b1 100644
--- a/NEWS
+++ b/NEWS
@@ -1,10 +1,13 @@
-portage-3.0.44 (?)
+portage-3.0.44 (UNRELEASED)
+--------------
 
 Bug fixes:
 * ebuild: the PATH variable exported to ebuilds has been changed:
   The PATH setting from /etc/profile.env is appended to portage-internal
   paths, and ROOTPATH is no longer included (bug #607696, #693308, #888543).
 
+* emerge: Fix installation of binpkgs by path (bug #873202, bug #890291).
+
 portage-3.0.43 (2023-01-02)
 --------------
 

diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index 6b08f9fe2..4d7a96a2d 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -18,6 +18,7 @@ from portage.const import (
     PORTAGE_PACKAGE_ATOM,
     USER_CONFIG_PATH,
     VCS_DIRS,
+    SUPPORTED_XPAK_EXTENSIONS,
     SUPPORTED_GPKG_EXTENSIONS,
 )
 from portage.dbapi import dbapi
@@ -4574,7 +4575,9 @@ class depgraph:
         onlydeps = "--onlydeps" in self._frozen_config.myopts
         lookup_owners = []
         for x in myfiles:
-            if x.endswith(".tbz2") or x.endswith(SUPPORTED_GPKG_EXTENSIONS):
+            if x.endswith(SUPPORTED_XPAK_EXTENSIONS) or x.endswith(
+                SUPPORTED_GPKG_EXTENSIONS
+            ):
                 if not os.path.exists(x):
                     if os.path.exists(os.path.join(pkgsettings["PKGDIR"], "All", x)):
                         x = os.path.join(pkgsettings["PKGDIR"], "All", x)
@@ -4608,7 +4611,7 @@ class depgraph:
                     mykey = None
                     cat = mytbz2.getfile("CATEGORY")
                 elif binpkg_format == "gpkg":
-                    mygpkg = portage.gpkg.gpkg(self.frozen_config, None, x)
+                    mygpkg = portage.gpkg.gpkg(root_config.settings, None, x)
                     mykey = None
                     cat = mygpkg.get_metadata("CATEGORY")
                 else:
@@ -4618,7 +4621,12 @@ class depgraph:
                     cat = _unicode_decode(
                         cat.strip(), encoding=_encodings["repo.content"]
                     )
-                    mykey = cat + "/" + os.path.basename(x)[:-5]
+                    if binpkg_format == "xpak":
+                        mykey = cat + "/" + os.path.basename(x)[:-5]
+                    elif binpkg_format == "gpkg":
+                        mykey = cat + "/" + os.path.basename(x)[:-9]
+                    else:
+                        raise InvalidBinaryPackageFormat(x)
 
                 if mykey is None:
                     writemsg(


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage:master commit in: /, lib/_emerge/
@ 2023-02-18  0:00 Sam James
  0 siblings, 0 replies; 9+ messages in thread
From: Sam James @ 2023-02-18  0:00 UTC (permalink / raw
  To: gentoo-commits

commit:     cdc8191e17e7dd1a6af1579ee2514a69811cf97b
Author:     Benjamin Gordon <bmgordon <AT> chromium <DOT> org>
AuthorDate: Tue Feb  4 18:40:13 2020 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Feb 18 00:00:12 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=cdc8191e

emerge: Log completion of package installs

The log currently shows Emerging/Installing progress messages, but
it doesn't indicate when a package finishes.  Since there can be dozens
of installs in flight at once, this makes it nearly impossible to
determine how long an individual package took.  This adds a similar
"Completed" line when the package merge completes.

Closes: https://github.com/gentoo/portage/pull/987
Reviewed-by: Mike Frysinger <vapier <AT> chromium.org>
Reviewed-by: Chris McDonald <cjmcdonald <AT> chromium.org>
Signed-off-by: Benjamin Gordon <bmgordon <AT> chromium.org>
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                        |  2 ++
 lib/_emerge/PackageMerge.py | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/NEWS b/NEWS
index fbc847c37..8a4d95144 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@ Features:
 
 * install-qa-check.d: 60pkgconfig: add opt-in QA_PKGCONFIG_VERSION check
 
+* emerge: Log completion of package installs.
+
 Bug fixes:
 * gpkg: Handle out-of-space errors (bug #891391).
 

diff --git a/lib/_emerge/PackageMerge.py b/lib/_emerge/PackageMerge.py
index f9e6bf8fe..82725c66a 100644
--- a/lib/_emerge/PackageMerge.py
+++ b/lib/_emerge/PackageMerge.py
@@ -58,5 +58,25 @@ class PackageMerge(CompositeTask):
 
     def _install_exit(self, task):
         self.postinst_failure = getattr(task, "postinst_failure", None)
+
+        pkg = self.merge.pkg
+        pkg_count = self.merge.pkg_count
+
+        if self.postinst_failure:
+            action_desc = "Failed"
+            preposition = "in"
+            counter_str = ""
+        else:
+            action_desc = "Completed"
+            preposition = "to"
+            counter_str = "({} of {}) ".format(
+                colorize("MERGE_LIST_PROGRESS", str(pkg_count.curval)),
+                colorize("MERGE_LIST_PROGRESS", str(pkg_count.maxval)),
+            )
+
+        if self._should_show_status():
+            msg = self._make_msg(pkg, action_desc, preposition, counter_str)
+            self.merge.statusMessage(msg)
+
         self._final_exit(task)
         self.wait()


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage:master commit in: /, lib/_emerge/
@ 2023-07-09  6:25 Sam James
  0 siblings, 0 replies; 9+ messages in thread
From: Sam James @ 2023-07-09  6:25 UTC (permalink / raw
  To: gentoo-commits

commit:     b199d0307b47f9fb06dbe533d7e24926a561c238
Author:     Oskari Pirhonen <xxc3ncoredxx <AT> gmail <DOT> com>
AuthorDate: Sun Jul  9 05:08:27 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul  9 06:24:28 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b199d030

depgraph.py: fix "no ebuilds/binpkgs" message

The "there are no binary packages to satisfy" was being unconditionally
output for packages that could not be found. Fix the logic for choosing
between the "binary packages" and "ebuilds" form of the message.

This is a temporary stopgap as alluded to by me in the bug, but the
tl;dr is that some entries in the `myopts` dict have "y"/"n" values
whereas some are True/unset, and this discrepancy should be sorted out.

[sam: Add NEWS and Fixes, although the change in that commit _shouldn't_
have been wrong, it is because of a quirk for now...]

Bug: https://bugs.gentoo.org/909853
Signed-off-by: Oskari Pirhonen <xxc3ncoredxx <AT> gmail.com>
Closes: https://github.com/gentoo/portage/pull/1065
Fixes: 0b21a5a392bd84c07b94373991f59108fbe98516
Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                    | 3 +++
 lib/_emerge/depgraph.py | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index d40c309cd..fe59a1ddf 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,9 @@ Bug fixes:
 * install-qa-check.d/05prefix: Fix prefixifying shebang for >= EAPI 7 ebuilds
   (bug #909147).
 
+* emerge: Fix 'no ebuilds available' message always mentioning binpkgs
+  (bug #909853).
+
 * gpkg: Fix timestamp for binary packages (bug #909067).
 
 portage-3.0.49 (2023-06-21)

diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index a36ab6351..1aeae6257 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -6456,7 +6456,7 @@ class depgraph:
                     cp_exists = True
                     break
 
-            if self._frozen_config.myopts.get("--usepkgonly", "y"):
+            if self._frozen_config.myopts.get("--usepkgonly", False):
                 writemsg(
                     f"\nemerge: there are no binary packages to satisfy {green(xinfo)}.\n",
                     noiselevel=-1,


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage:master commit in: /, lib/_emerge/
@ 2023-08-17  6:53 Sam James
  0 siblings, 0 replies; 9+ messages in thread
From: Sam James @ 2023-08-17  6:53 UTC (permalink / raw
  To: gentoo-commits

commit:     ab71ec960b65b2d77e5669d8979dc72e3f4ffb41
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 17 06:46:53 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Aug 17 06:52:55 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ab71ec96

lib: _emerge: call portage.util.initialize_logger()

We don't have a root logger setup otherwise which means we can't get nice
output from things like gemato which define their own logger names/domains.

And respect --debug for it.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                | 9 +++++++++
 lib/_emerge/main.py | 4 ++++
 2 files changed, 13 insertions(+)

diff --git a/NEWS b/NEWS
index d442a42ab0..ad541b95b1 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,12 @@
+portage-3.0.51 (UNRELEASED)
+--------------
+
+Features:
+* emerge: Set up logging immediately and respect --debug for log level.
+
+* sync: git, rsync: now respects --debug for better output from gemato. This is
+  especially useful for debugging hangs during the 'Refreshing keys' stage.
+
 portage-3.0.50 (2023-08-09)
 --------------
 

diff --git a/lib/_emerge/main.py b/lib/_emerge/main.py
index 41bed09696..d92f069901 100644
--- a/lib/_emerge/main.py
+++ b/lib/_emerge/main.py
@@ -1191,6 +1191,10 @@ def emerge_main(args: Optional[list[str]] = None):
     myaction, myopts, myfiles = parse_opts(args, silent=True)
     if "--debug" in myopts:
         os.environ["PORTAGE_DEBUG"] = "1"
+        portage.util.initialize_logger(logging.DEBUG)
+    else:
+        portage.util.initialize_logger()
+
     if "--config-root" in myopts:
         os.environ["PORTAGE_CONFIGROOT"] = myopts["--config-root"]
     if "--sysroot" in myopts:


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage:master commit in: /, lib/_emerge/
@ 2023-10-02 11:47 Sam James
  0 siblings, 0 replies; 9+ messages in thread
From: Sam James @ 2023-10-02 11:47 UTC (permalink / raw
  To: gentoo-commits

commit:     2b0a904f6b3e0376d0ee2359469d8732c11e376b
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Oct  1 21:36:23 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct  2 11:47:53 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2b0a904f

search: fix 'mlen' counter for ambiguous package names

self.mlen was being incremented in both addCP() and output().

Drop the increment in addCP(), and convert mlen to a function-local
variable in output().

Bug: https://bugs.gentoo.org/915054
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1106
Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                  |  3 +++
 lib/_emerge/search.py | 14 +++-----------
 2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/NEWS b/NEWS
index aa2b39ee9b..bfa6261bb9 100644
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,9 @@ Bug fixes:
 
 * dispatch-conf, etc-update: fix SELinux security labels on merged files.
 
+* emerge: fix application count when listing search results for ambiguous
+  packages (bug #915054).
+
 Cleanups:
 * vartree: Remove unused variables and parameters
 

diff --git a/lib/_emerge/search.py b/lib/_emerge/search.py
index e422434a72..62406258d0 100644
--- a/lib/_emerge/search.py
+++ b/lib/_emerge/search.py
@@ -57,7 +57,6 @@ class search:
         self.fuzzy = fuzzy
         self.search_similarity = 80 if search_similarity is None else search_similarity
         self.matches = {"pkg": []}
-        self.mlen = 0
 
         self._dbs = []
 
@@ -377,7 +376,6 @@ class search:
         if not self._xmatch("match-all", cp):
             return
         self.matches["pkg"].append(cp)
-        self.mlen += 1
 
     def output(self):
         """Outputs the results of the search."""
@@ -407,8 +405,9 @@ class search:
             # Do a normal search
             iterator = self._iter_search()
 
+        mlen = 0
         for mtype, match in iterator:
-            self.mlen += 1
+            mlen += 1
             masked = False
             full_package = None
             if mtype in ("pkg", "desc"):
@@ -521,14 +520,7 @@ class search:
                         "      " + darkgreen("License:") + "       " + license + "\n\n"
                     )
 
-        msg.append("[ Applications found : " + bold(str(self.mlen)) + " ]\n\n")
-
-        # This method can be called multiple times, so
-        # reset the match count for the next call. Don't
-        # reset it at the beginning of this method, since
-        # that would lose modfications from the addCP
-        # method.
-        self.mlen = 0
+        msg.append("[ Applications found : " + bold(str(mlen)) + " ]\n\n")
 
     #
     # private interface


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage:master commit in: /, lib/_emerge/
@ 2023-10-02 12:22 Sam James
  0 siblings, 0 replies; 9+ messages in thread
From: Sam James @ 2023-10-02 12:22 UTC (permalink / raw
  To: gentoo-commits

commit:     7b855cb2bb50c59d5310f9e0326e8c49e4f29111
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Mon Oct  2 10:21:10 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct  2 12:22:24 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7b855cb2

depgraph: show backtrack information after dep resolution

To improve user's awareness of the backtracking performed by portage
and the related limit, show briefly how much backtracking was done.

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1107
Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                    |  2 ++
 lib/_emerge/depgraph.py | 21 +++++++++++++++------
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/NEWS b/NEWS
index bfa6261bb9..75680fce18 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,8 @@ Features:
 * emerge: Use appropriate colors if binpkgs are used in e.g. pkg_pretend
   messages as well as elog's mod_echo module (bug #914159).
 
+* Show backtrack information after dependency resolution.
+
 Bug fixes:
 * Prevent gpg from removing /dev/null when unlocking signing key (bug #912808).
 

diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index ef7dd54052..a0d69ff305 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -11401,7 +11401,7 @@ def _spinner_start(spinner, myopts):
     spinner.start_time = time.time()
 
 
-def _spinner_stop(spinner):
+def _spinner_stop(spinner, backtracked: int = -1, max_retries: int = -1):
     if spinner is None or spinner.update == spinner.update_quiet:
         return
 
@@ -11414,7 +11414,14 @@ def _spinner_stop(spinner):
 
     stop_time = time.time()
     time_fmt = f"{stop_time - spinner.start_time:.2f}"
-    portage.writemsg_stdout(f"Dependency resolution took {darkgreen(time_fmt)} s.\n\n")
+
+    backtrack_info = ""
+    if backtracked >= 0:
+        backtrack_info = f" (backtrack: {backtracked}/{max_retries})"
+
+    portage.writemsg_stdout(
+        f"Dependency resolution took {darkgreen(time_fmt)} s{backtrack_info}.\n\n"
+    )
 
 
 def backtrack_depgraph(
@@ -11430,13 +11437,15 @@ def backtrack_depgraph(
 
     Raises PackageSetNotFound if myfiles contains a missing package set.
     """
+    backtracked, max_retries = -1, -1
     _spinner_start(spinner, myopts)
     try:
-        return _backtrack_depgraph(
+        success, mydepgraph, favorites, backtracked, max_retries = _backtrack_depgraph(
             settings, trees, myopts, myparams, myaction, myfiles, spinner
         )
+        return (success, mydepgraph, favorites)
     finally:
-        _spinner_stop(spinner)
+        _spinner_stop(spinner, backtracked, max_retries)
 
 
 def _backtrack_depgraph(
@@ -11447,7 +11456,7 @@ def _backtrack_depgraph(
     myaction: Optional[str],
     myfiles: list[str],
     spinner: "_emerge.stdout_spinner.stdout_spinner",
-) -> tuple[Any, depgraph, list[str]]:
+) -> tuple[Any, depgraph, list[str], int, int]:
     debug = "--debug" in myopts
     mydepgraph = None
     max_retries = myopts.get("--backtrack", 10)
@@ -11540,7 +11549,7 @@ def _backtrack_depgraph(
         )
         success, favorites = mydepgraph.select_files(myfiles)
 
-    return (success, mydepgraph, favorites)
+    return (success, mydepgraph, favorites, backtracked, max_retries)
 
 
 def resume_depgraph(


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage:master commit in: /, lib/_emerge/
@ 2024-08-02 13:38 James Le Cuirot
  0 siblings, 0 replies; 9+ messages in thread
From: James Le Cuirot @ 2024-08-02 13:38 UTC (permalink / raw
  To: gentoo-commits

commit:     6d1ee2c4f1ccd1bc783a6433a22166dbcfdd21e9
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 18 09:27:55 2024 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Fri Aug  2 13:34:57 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6d1ee2c4

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 <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1347
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 NEWS                            |  1 +
 lib/_emerge/JobStatusDisplay.py | 10 +++++++++-
 lib/_emerge/Scheduler.py        |  3 +++
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index e8ba29df68..04ce6069db 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 9cf3c41db4..f9e034c6e5 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 e23ebeb7ac..283144b55a 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
 


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-08-02 13:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-09  6:25 [gentoo-commits] proj/portage:master commit in: /, lib/_emerge/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2024-08-02 13:38 James Le Cuirot
2023-10-02 12:22 Sam James
2023-10-02 11:47 Sam James
2023-08-17  6:53 Sam James
2023-02-18  0:00 Sam James
2023-01-10  3:28 Sam James
2023-01-10  3:28 Sam James
2022-11-23 23:02 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox