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