commit:     57f9327fecca859952140e3122cce51c55a9347a
Author:     Thomas Bracht Laumann Jespersen <t <AT> laumann <DOT> xyz>
AuthorDate: Thu Jan 22 06:00:12 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jan 23 00:51:53 2026 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=57f9327f

eclean/search: add invalid binpkgs to location only if found

When bintree.invalid_paths is empty we should omit assigning it to the
location, otherwise the output will still present the banner with "the
following invalid binpkgs were found" but not actually list any files.

Signed-off-by: Thomas Bracht Laumann Jespersen <t <AT> laumann.xyz>
Part-of: https://codeberg.org/gentoo/gentoolkit/pulls/5
Merges: https://codeberg.org/gentoo/gentoolkit/pulls/5
Signed-off-by: Sam James <sam <AT> gentoo.org>

 pym/gentoolkit/eclean/search.py | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/pym/gentoolkit/eclean/search.py b/pym/gentoolkit/eclean/search.py
index b177833..044c011 100644
--- a/pym/gentoolkit/eclean/search.py
+++ b/pym/gentoolkit/eclean/search.py
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 
-# Copyright 2003-2024 Gentoo Authors
+# Copyright 2003-2026 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 
@@ -780,13 +780,14 @@ def findPackages(
             )
 
         try:
-            invalid_paths[location] = bin_dbapi.bintree.invalid_paths
-            # A little dirty, but it makes the structure of
-            # invalid_paths match the structure of dead_binpkgs.
-            for file_ in invalid_paths[location]:
-                if len(invalid_paths[location][file_]) == 1:
-                    full_path = invalid_paths[location][file_][0]
-                    invalid_paths[location][file_] = (full_path, None)
+            if len(bin_dbapi.bintree.invalid_paths) > 0:
+                invalid_paths[location] = bin_dbapi.bintree.invalid_paths
+                # A little dirty, but it makes the structure of
+                # invalid_paths match the structure of dead_binpkgs.
+                for file_ in invalid_paths[location]:
+                    if len(invalid_paths[location][file_]) == 1:
+                        full_path = invalid_paths[location][file_][0]
+                        invalid_paths[location][file_] = (full_path, None)
         except AttributeError:
             # if bintree.invalid_paths was not initialized, this is a
             # hard error and we can just return here

Reply via email to