Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Zac Medico <zmedico@g.o>
Subject: [gentoo-portage-dev] [PATCH] dbapi: fix repoman implicit IUSE (bug 660982)
Date: Thu, 12 Jul 2018 09:59:33
Message-Id: 20180712095903.10901-1-zmedico@gentoo.org
1 Account for repoman modifications of the portdbapi self.settings
2 reference, and treat all flags as valid for the empty profile
3 because it does not have any implicit IUSE settings.
4
5 Bug: https://bugs.gentoo.org/660982
6 ---
7 pym/_emerge/Package.py | 5 ++++-
8 pym/portage/dbapi/__init__.py | 16 ++++++++++++++++
9 2 files changed, 20 insertions(+), 1 deletion(-)
10
11 diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
12 index a7ce00bc9..5f34f3d27 100644
13 --- a/pym/_emerge/Package.py
14 +++ b/pym/_emerge/Package.py
15 @@ -93,7 +93,10 @@ class Package(Task):
16 # sync metadata with validated repo (may be UNKNOWN_REPO)
17 self._metadata['repository'] = self.cpv.repo
18
19 - implicit_match = db._iuse_implicit_cnstr(self.cpv, self._metadata)
20 + if self.root_config.settings.local_config:
21 + implicit_match = db._iuse_implicit_cnstr(self.cpv, self._metadata)
22 + else:
23 + implicit_match = db._repoman_iuse_implicit_cnstr(self.cpv, self._metadata)
24 usealiases = self.root_config.settings._use_manager.getUseAliases(self)
25 self.iuse = self._iuse(self, self._metadata["IUSE"].split(),
26 implicit_match, usealiases, self.eapi)
27 diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py
28 index d320cc75f..61d301839 100644
29 --- a/pym/portage/dbapi/__init__.py
30 +++ b/pym/portage/dbapi/__init__.py
31 @@ -216,6 +216,22 @@ class dbapi(object):
32
33 yield cpv
34
35 + def _repoman_iuse_implicit_cnstr(self, pkg, metadata):
36 + """
37 + In repoman's version of _iuse_implicit_cnstr, account for modifications
38 + of the self.settings reference between calls, and treat all flags as
39 + valid for the empty profile because it does not have any implicit IUSE
40 + settings. See bug 660982.
41 + """
42 + eapi_attrs = _get_eapi_attrs(metadata["EAPI"])
43 + if eapi_attrs.iuse_effective:
44 + iuse_implicit_match = lambda flag: (True if not self.settings.profile_path
45 + else self.settings._iuse_effective_match(flag))
46 + else:
47 + iuse_implicit_match = lambda flag: (True if not self.settings.profile_path
48 + else self.settings._iuse_implicit_match(flag))
49 + return iuse_implicit_match
50 +
51 def _iuse_implicit_cnstr(self, pkg, metadata):
52 """
53 Construct a callable that checks if a given USE flag should
54 --
55 2.13.6

Replies