From c8530deda6b85dad1f7557d490f8a200e8bfa54e Mon Sep 17 00:00:00 2001 From: Arfrever Frehtes Taifersar Arahesis Date: Fri, 7 Jun 2013 22:41:28 +0200 Subject: [PATCH] portage.dbapi.dbapi._match_use(): Use _emerge.Package.Package._iuse.get_real_flag(). It fixes support for USE aliases in: best_version has_version emerge --keep-going emerge --resume --- pym/portage/dbapi/__init__.py | 40 +++++++++++++++-------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py index ab4306d70..f954bad94 100644 --- a/pym/portage/dbapi/__init__.py +++ b/pym/portage/dbapi/__init__.py @@ -204,10 +204,11 @@ class dbapi(object): iuse_implicit_match = self.settings._iuse_effective_match else: iuse_implicit_match = self.settings._iuse_implicit_match - iuse = frozenset(x.lstrip('+-') for x in metadata["IUSE"].split()) + usealiases = self.settings._use_manager.getUseAliases(self._pkg_str(cpv, metadata["repository"])) + iuse = Package._iuse(None, metadata["IUSE"].split(), iuse_implicit_match, usealiases, metadata["EAPI"]) for x in atom.unevaluated_atom.use.required: - if x not in iuse and not iuse_implicit_match(x): + if iuse.get_real_flag(x) is None: return False if atom.use is None: @@ -220,27 +221,24 @@ class dbapi(object): # data corruption). The enabled flags must be consistent # with implicit IUSE, in order to avoid potential # inconsistencies in USE dep matching (see bug #453400). - use = frozenset(x for x in metadata["USE"].split() - if x in iuse or iuse_implicit_match(x)) - 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): + use = frozenset(x for x in metadata["USE"].split() if iuse.get_real_flag(x) is not None) + missing_enabled = frozenset(x for x in atom.use.missing_enabled if iuse.get_real_flag(x) is None) + missing_disabled = frozenset(x for x in atom.use.missing_disabled if iuse.get_real_flag(x) is None) + enabled = frozenset((iuse.get_real_flag(x) or x) for x in atom.use.enabled) + disabled = frozenset((iuse.get_real_flag(x) or x) for x in atom.use.disabled) + + if enabled: + if any(x in enabled for x in missing_disabled): return False - need_enabled = atom.use.enabled.difference(use) + need_enabled = enabled.difference(use) if need_enabled: if any(x not in missing_enabled for x in need_enabled): return False - if atom.use.disabled: - if any(x in atom.use.disabled for x in missing_enabled): + if disabled: + if any(x in disabled for x in missing_enabled): return False - need_disabled = atom.use.disabled.intersection(use) + need_disabled = disabled.intersection(use) if need_disabled: if any(x not in missing_disabled for x in need_disabled): return False @@ -266,15 +264,11 @@ class dbapi(object): # Check unsatisfied use-default deps if atom.use.enabled: - missing_disabled = frozenset(x for x in - atom.use.missing_disabled if not - (x in iuse or iuse_implicit_match(x))) + missing_disabled = frozenset(x for x in atom.use.missing_disabled if iuse.get_real_flag(x) is None) if any(x in atom.use.enabled for x in missing_disabled): return False if atom.use.disabled: - missing_enabled = frozenset(x for x in - atom.use.missing_enabled if not - (x in iuse or iuse_implicit_match(x))) + missing_enabled = frozenset(x for x in atom.use.missing_enabled if iuse.get_real_flag(x) is None) if any(x in atom.use.disabled for x in missing_enabled): return False -- 2.26.2