Skip to content

Commit

Permalink
eclean: Strip libc dependencies from --changed-deps calculations
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/921679
Signed-off-by: Matt Turner <[email protected]>
  • Loading branch information
mattst88 committed Jan 11, 2024
1 parent eeb0771 commit e855239
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pym/gentoolkit/eclean/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
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 (
Expand Down Expand Up @@ -522,13 +523,15 @@ def _check_excludes(self, exclude, clean_me):
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
Expand Down Expand Up @@ -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, True)

# Create a dictionary of all installed packages
if destructive and package_names:
installed = dict.fromkeys(var_dbapi.cp_all())
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e855239

Please sign in to comment.