From 2f9ee1635ca33f347e6eaa523e965c7172cd481e Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 21 Jan 2013 13:30:13 -0800 Subject: [PATCH] Fix default use match for implicit IUSE. This will fix bug #453400, which was triggered by inconsistency between the enabled USE and the effective missing_disabled set used in matching logic, due to implicit IUSE. --- pym/_emerge/depgraph.py | 7 +++++-- pym/portage/dbapi/__init__.py | 16 ++++++++++++---- pym/portage/dep/__init__.py | 8 +++++--- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 7a967957c..73ee3e982 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -4418,8 +4418,11 @@ class depgraph(object): use_match = True can_adjust_use = not pkg.built - missing_enabled = atom.use.missing_enabled.difference(pkg.iuse.all) - missing_disabled = atom.use.missing_disabled.difference(pkg.iuse.all) + is_valid_flag = pkg.iuse.is_valid_flag + missing_enabled = frozenset(x for x in + atom.use.missing_enabled if not is_valid_flag(x)) + missing_disabled = frozenset(x for x in + atom.use.missing_disabled if not is_valid_flag(x)) if atom.use.enabled: if any(x in atom.use.enabled for x in missing_disabled): diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py index 5828bcacd..3540c6dc6 100644 --- a/pym/portage/dbapi/__init__.py +++ b/pym/portage/dbapi/__init__.py @@ -220,8 +220,12 @@ class dbapi(object): # data corruption). use = frozenset(x for x in metadata["USE"].split() if x in iuse or iuse_implicit_match(x)) - missing_enabled = atom.use.missing_enabled.difference(iuse) - missing_disabled = atom.use.missing_disabled.difference(iuse) + missing_enabled = frozenset(x for x in + atom.use.missing_enabled if not + (x in iuse or iuse_implicit_match(x))) + missing_disabled = frozenset(x for x in + atom.use.missing_disabled if not + (x in iuse or iuse_implicit_match(x))) if atom.use.enabled: if any(x in atom.use.enabled for x in missing_disabled): @@ -258,11 +262,15 @@ class dbapi(object): # Check unsatisfied use-default deps if atom.use.enabled: - missing_disabled = atom.use.missing_disabled.difference(iuse) + missing_disabled = frozenset(x for x in + atom.use.missing_disabled if not + (x in iuse or iuse_implicit_match(x))) if any(x in atom.use.enabled for x in missing_disabled): return False if atom.use.disabled: - missing_enabled = atom.use.missing_enabled.difference(iuse) + missing_enabled = frozenset(x for x in + atom.use.missing_enabled if not + (x in iuse or iuse_implicit_match(x))) if any(x in atom.use.disabled for x in missing_enabled): return False diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index 511753116..1edbab76f 100644 --- a/pym/portage/dep/__init__.py +++ b/pym/portage/dep/__init__.py @@ -2282,9 +2282,11 @@ def match_from_list(mydep, candidate_list): continue if mydep.use: - - missing_enabled = mydep.use.missing_enabled.difference(x.iuse.all) - missing_disabled = mydep.use.missing_disabled.difference(x.iuse.all) + is_valid_flag = x.iuse.is_valid_flag + missing_enabled = frozenset(flag for flag in + mydep.use.missing_enabled if not is_valid_flag(flag)) + missing_disabled = frozenset(flag for flag in + mydep.use.missing_disabled if not is_valid_flag(flag)) if mydep.use.enabled: if any(f in mydep.use.enabled for f in missing_disabled): -- 2.26.2