aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2018-07-12 02:48:32 -0700
committerZac Medico <zmedico@gentoo.org>2018-07-14 16:31:34 -0700
commite691f07bf0572fad7686a54d628c1a29aec4ebe4 (patch)
tree7fb45ee0e790db21cc1b65bb9d0e756aaa782cfe
parentrepoman: add a check for unsorted KEYWORDS (diff)
downloadportage-e691f07b.tar.gz
portage-e691f07b.tar.bz2
portage-e691f07b.zip
dbapi: fix repoman implicit IUSE (bug 660982)
Account for repoman modifications of the portdbapi self.settings reference, and treat all flags as valid for the empty profile because it does not have any implicit IUSE settings. Bug: https://bugs.gentoo.org/660982 Reviewed-by: Brian Dolbec <dolsen@gentoo.org>
-rw-r--r--pym/_emerge/Package.py5
-rw-r--r--pym/portage/dbapi/__init__.py16
2 files changed, 20 insertions, 1 deletions
diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index a7ce00bc9..5f34f3d27 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -93,7 +93,10 @@ class Package(Task):
# sync metadata with validated repo (may be UNKNOWN_REPO)
self._metadata['repository'] = self.cpv.repo
- implicit_match = db._iuse_implicit_cnstr(self.cpv, self._metadata)
+ if self.root_config.settings.local_config:
+ implicit_match = db._iuse_implicit_cnstr(self.cpv, self._metadata)
+ else:
+ implicit_match = db._repoman_iuse_implicit_cnstr(self.cpv, self._metadata)
usealiases = self.root_config.settings._use_manager.getUseAliases(self)
self.iuse = self._iuse(self, self._metadata["IUSE"].split(),
implicit_match, usealiases, self.eapi)
diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py
index d320cc75f..61d301839 100644
--- a/pym/portage/dbapi/__init__.py
+++ b/pym/portage/dbapi/__init__.py
@@ -216,6 +216,22 @@ class dbapi(object):
yield cpv
+ def _repoman_iuse_implicit_cnstr(self, pkg, metadata):
+ """
+ In repoman's version of _iuse_implicit_cnstr, account for modifications
+ of the self.settings reference between calls, and treat all flags as
+ valid for the empty profile because it does not have any implicit IUSE
+ settings. See bug 660982.
+ """
+ eapi_attrs = _get_eapi_attrs(metadata["EAPI"])
+ if eapi_attrs.iuse_effective:
+ iuse_implicit_match = lambda flag: (True if not self.settings.profile_path
+ else self.settings._iuse_effective_match(flag))
+ else:
+ iuse_implicit_match = lambda flag: (True if not self.settings.profile_path
+ else self.settings._iuse_implicit_match(flag))
+ return iuse_implicit_match
+
def _iuse_implicit_cnstr(self, pkg, metadata):
"""
Construct a callable that checks if a given USE flag should