commit:     a3e56252cdde2f4fb51766c580c0137f28843510
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 11 21:31:12 2024 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Fri Jan 12 19:15:28 2024 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=a3e56252

eclean: Strip libc dependencies from --changed-deps calculations

Closes: https://bugs.gentoo.org/921679
Closes: https://github.com/gentoo/gentoolkit/pull/38
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 pym/gentoolkit/eclean/search.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/pym/gentoolkit/eclean/search.py b/pym/gentoolkit/eclean/search.py
index de424c5..f03c521 100644
--- a/pym/gentoolkit/eclean/search.py
+++ b/pym/gentoolkit/eclean/search.py
@@ -15,6 +15,7 @@ from typing import Optional
 import portage
 from portage.dep import Atom, use_reduce
 from portage.dep._slot_operator import strip_slots
+from portage.dep.libc import find_libc_deps, strip_libc_deps
 
 import gentoolkit.pprinter as pp
 from gentoolkit.eclean.exclude import (
@@ -522,13 +523,15 @@ class DistfilesSearch:
         return clean_me, saved
 
 
-def _deps_equal(deps_a, eapi_a, deps_b, eapi_b, uselist=None):
+def _deps_equal(deps_a, eapi_a, deps_b, eapi_b, libc_deps, uselist=None):
     """Compare two dependency lists given a set of USE flags"""
     if deps_a == deps_b:
         return True
 
     deps_a = use_reduce(deps_a, uselist=uselist, eapi=eapi_a, token_class=Atom)
     deps_b = use_reduce(deps_b, uselist=uselist, eapi=eapi_b, token_class=Atom)
+    strip_libc_deps(deps_a, libc_deps)
+    strip_libc_deps(deps_b, libc_deps)
     strip_slots(deps_a)
     strip_slots(deps_b)
     return deps_a == deps_b
@@ -583,6 +586,8 @@ def findPackages(
         print(pp.error("Error: %s" % str(er)), file=sys.stderr)
         exit(1)
 
+    libc_deps = find_libc_deps(var_dbapi, False)
+
     # Create a dictionary of all installed packages
     if destructive and package_names:
         installed = dict.fromkeys(var_dbapi.cp_all())
@@ -653,6 +658,7 @@ def findPackages(
                 binpkg_metadata["EAPI"],
                 " ".join(ebuild_metadata[key] for key in dep_keys),
                 ebuild_metadata["EAPI"],
+                libc_deps,
                 frozenset(binpkg_metadata["USE"].split()),
             ):
                 continue

Reply via email to