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] repoman: suppress dependency.badmasked triggered by use.force and use.mask
Date: Mon, 05 Oct 2015 00:36:32
Message-Id: 1444005314-13867-1-git-send-email-zmedico@gentoo.org
1 Add 'minimum-all-ignore-profile' mode to portbapi.xmatch, and use
2 it to ignore interactions between USE deps, use.force, and use.mask.
3 ---
4 pym/portage/dbapi/__init__.py | 23 ++++++++++++-----------
5 pym/portage/dbapi/porttree.py | 18 +++++++++++-------
6 pym/repoman/scanner.py | 2 +-
7 3 files changed, 24 insertions(+), 19 deletions(-)
8
9 diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py
10 index b6745fa..9505384 100644
11 --- a/pym/portage/dbapi/__init__.py
12 +++ b/pym/portage/dbapi/__init__.py
13 @@ -215,7 +215,7 @@ class dbapi(object):
14
15 yield cpv
16
17 - def _match_use(self, atom, pkg, metadata):
18 + def _match_use(self, atom, pkg, metadata, ignore_profile=False):
19 eapi_attrs = _get_eapi_attrs(metadata["EAPI"])
20 if eapi_attrs.iuse_effective:
21 iuse_implicit_match = self.settings._iuse_effective_match
22 @@ -261,17 +261,18 @@ class dbapi(object):
23 return False
24
25 elif not self.settings.local_config:
26 - # Check masked and forced flags for repoman.
27 - usemask = self.settings._getUseMask(pkg,
28 - stable=self.settings._parent_stable)
29 - if any(x in usemask for x in atom.use.enabled):
30 - return False
31 + if not ignore_profile:
32 + # Check masked and forced flags for repoman.
33 + usemask = self.settings._getUseMask(pkg,
34 + stable=self.settings._parent_stable)
35 + if any(x in usemask for x in atom.use.enabled):
36 + return False
37
38 - useforce = self.settings._getUseForce(pkg,
39 - stable=self.settings._parent_stable)
40 - if any(x in useforce and x not in usemask
41 - for x in atom.use.disabled):
42 - return False
43 + useforce = self.settings._getUseForce(pkg,
44 + stable=self.settings._parent_stable)
45 + if any(x in useforce and x not in usemask
46 + for x in atom.use.disabled):
47 + return False
48
49 # Check unsatisfied use-default deps
50 if atom.use.enabled:
51 diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
52 index d13fdee..a954de5 100644
53 --- a/pym/portage/dbapi/porttree.py
54 +++ b/pym/portage/dbapi/porttree.py
55 @@ -809,9 +809,9 @@ class portdbapi(dbapi):
56 return mylist
57
58 def freeze(self):
59 - for x in "bestmatch-visible", "cp-list", "match-all", \
60 - "match-all-cpv-only", "match-visible", "minimum-all", \
61 - "minimum-visible":
62 + for x in ("bestmatch-visible", "cp-list", "match-all",
63 + "match-all-cpv-only", "match-visible", "minimum-all",
64 + "minimum-all-ignore-profile", "minimum-visible"):
65 self.xcache[x]={}
66 self.frozen=1
67
68 @@ -870,8 +870,9 @@ class portdbapi(dbapi):
69 myval = match_from_list(mydep,
70 self.cp_list(mykey, mytree=mytree))
71
72 - elif level in ("bestmatch-visible", "match-all", "match-visible",
73 - "minimum-all", "minimum-visible"):
74 + elif level in ("bestmatch-visible", "match-all",
75 + "match-visible", "minimum-all", "minimum-all-ignore-profile",
76 + "minimum-visible"):
77 # Find the minimum matching visible version. This is optimized to
78 # minimize the number of metadata accesses (improves performance
79 # especially in cases where metadata needs to be generated).
80 @@ -881,7 +882,9 @@ class portdbapi(dbapi):
81 mylist = match_from_list(mydep,
82 self.cp_list(mykey, mytree=mytree))
83
84 - visibility_filter = level not in ("match-all", "minimum-all")
85 + ignore_profile = level in ("minimum-all-ignore-profile",)
86 + visibility_filter = level not in ("match-all",
87 + "minimum-all", "minimum-all-ignore-profile")
88 single_match = level not in ("match-all", "match-visible")
89 myval = []
90 aux_keys = list(self._aux_cache_keys)
91 @@ -922,7 +925,8 @@ class portdbapi(dbapi):
92 continue
93
94 if mydep.unevaluated_atom.use is not None and \
95 - not self._match_use(mydep, pkg_str, metadata):
96 + not self._match_use(mydep, pkg_str, metadata,
97 + ignore_profile=ignore_profile):
98 continue
99
100 myval.append(pkg_str)
101 diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
102 index ff32ac8..0194017 100644
103 --- a/pym/repoman/scanner.py
104 +++ b/pym/repoman/scanner.py
105 @@ -633,7 +633,7 @@ class Scanner(object):
106 continue
107 # we are testing deps for a masked package; give it some lee-way
108 suffix = "masked"
109 - matchmode = "minimum-all"
110 + matchmode = "minimum-all-ignore-profile"
111 else:
112 suffix = ""
113 matchmode = "minimum-visible"
114 --
115 2.4.6

Replies