Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r9540 - in main/branches/2.1.2: bin pym
Date: Fri, 28 Mar 2008 11:11:17
Message-Id: E1JfCUM-0006Or-2r@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-03-28 11:11:12 +0000 (Fri, 28 Mar 2008)
3 New Revision: 9540
4
5 Modified:
6 main/branches/2.1.2/bin/emerge
7 main/branches/2.1.2/pym/portage.py
8 Log:
9 Bug #211554 - Replace references to config["USE"] with references to
10 config["PORTAGE_USE"] (which is filtered for intersection with IUSE)
11 so that dependency calculations at installation time are consistent
12 with those at depclean time. (trunk r9391:9393)
13
14
15 Modified: main/branches/2.1.2/bin/emerge
16 ===================================================================
17 --- main/branches/2.1.2/bin/emerge 2008-03-28 10:21:22 UTC (rev 9539)
18 +++ main/branches/2.1.2/bin/emerge 2008-03-28 11:11:12 UTC (rev 9540)
19 @@ -1218,7 +1218,7 @@
20 metadata = None
21 if metadata and not built:
22 pkgsettings.setcpv(cpv, mydb=metadata)
23 - metadata["USE"] = pkgsettings.get("USE", "")
24 + metadata["USE"] = pkgsettings["PORTAGE_USE"]
25 if metadata is None:
26 mreasons = ["corruption"]
27 else:
28 @@ -1667,7 +1667,7 @@
29 mydbapi.aux_get(mykey, self._mydbapi_keys)))
30 if mytype == "ebuild":
31 pkgsettings.setcpv(mykey, mydb=portdb)
32 - metadata["USE"] = pkgsettings["USE"]
33 + metadata["USE"] = pkgsettings["PORTAGE_USE"]
34 myuse = metadata["USE"].split()
35
36 if not arg and myroot == self.target_root:
37 @@ -2413,7 +2413,7 @@
38 pkgsettings.setcpv(myeb, mydb=mydb)
39 else:
40 pkgsettings.setcpv(myeb_pkg, mydb=mydb)
41 - now_use = pkgsettings["USE"].split()
42 + now_use = pkgsettings["PORTAGE_USE"].split()
43 forced_flags = set()
44 forced_flags.update(pkgsettings.useforce)
45 forced_flags.update(pkgsettings.usemask)
46 @@ -2434,7 +2434,7 @@
47 metadata = dict(izip(self._mydbapi_keys,
48 portdb.aux_get(myeb, self._mydbapi_keys)))
49 pkgsettings.setcpv(myeb, mydb=portdb)
50 - metadata["USE"] = pkgsettings["USE"]
51 + metadata["USE"] = pkgsettings["PORTAGE_USE"]
52 matched_packages.append(
53 (["ebuild", myroot, myeb], metadata))
54
55 @@ -3367,7 +3367,7 @@
56 repo_path_real = os.path.dirname(os.path.dirname(
57 os.path.dirname(ebuild_path)))
58 pkgsettings.setcpv(pkg_key, mydb=mydbapi)
59 - metadata["USE"] = pkgsettings["USE"]
60 + metadata["USE"] = pkgsettings["PORTAGE_USE"]
61 else:
62 repo_path_real = portdb.getRepositoryPath(repo_name)
63 pkg_use = metadata["USE"].split()
64 @@ -3914,7 +3914,8 @@
65 if pkg_type == "ebuild":
66 pkgsettings = self.pkgsettings[myroot]
67 pkgsettings.setcpv(pkg_key, mydb=fakedb[myroot])
68 - fakedb[myroot].aux_update(pkg_key, {"USE":pkgsettings["USE"]})
69 + fakedb[myroot].aux_update(pkg_key,
70 + {"USE":pkgsettings["PORTAGE_USE"]})
71 self.spinner.update()
72
73 class RepoDisplay(object):
74 @@ -4202,7 +4203,7 @@
75 metadata.update(izip(metadata_keys,
76 mydbapi.aux_get(pkg_key, metadata_keys)))
77 pkgsettings.setcpv(pkg_key, mydb=mydbapi)
78 - metadata["USE"] = pkgsettings["USE"]
79 + metadata["USE"] = pkgsettings["PORTAGE_USE"]
80 else:
81 if pkg_type == "binary":
82 mydbapi = bindb
83 @@ -5864,8 +5865,8 @@
84 if portdb.cpv_exists(pkg):
85 mydb = portdb
86 pkgsettings.setcpv(pkg, mydb=mydb)
87 - if valuesmap["IUSE"].intersection(pkgsettings["USE"].split()) != \
88 - valuesmap["USE"]:
89 + if valuesmap["IUSE"].intersection(
90 + pkgsettings["PORTAGE_USE"].split()) != valuesmap["USE"]:
91 diff_values["USE"] = valuesmap["USE"]
92 # If a difference was found, print the info for
93 # this package.
94
95 Modified: main/branches/2.1.2/pym/portage.py
96 ===================================================================
97 --- main/branches/2.1.2/pym/portage.py 2008-03-28 10:21:22 UTC (rev 9539)
98 +++ main/branches/2.1.2/pym/portage.py 2008-03-28 11:11:12 UTC (rev 9540)
99 @@ -1429,7 +1429,7 @@
100
101 # Blacklist vars that could interfere with portage internals.
102 for blacklisted in "CATEGORY", "PKGUSE", "PORTAGE_CONFIGROOT", \
103 - "ROOT":
104 + "PORTAGE_IUSE", "PORTAGE_USE", "ROOT":
105 for cfg in self.lookuplist:
106 cfg.pop(blacklisted, None)
107 del blacklisted, cfg
108 @@ -1874,6 +1874,7 @@
109 self.modifying()
110 if self.mycpv == mycpv:
111 return
112 + ebuild_phase = self.get("EBUILD_PHASE")
113 has_changed = False
114 self.mycpv = mycpv
115 cp = dep_getkey(mycpv)
116 @@ -1950,7 +1951,7 @@
117 if "test" in self.features:
118 test_use_changed = \
119 bool(re.search(r'(^|\s)[-+]?test(\s|$)', iuse)) != \
120 - ("test" in self.get("PORTAGE_USE","").split())
121 + ("test" in self["USE"].split())
122 if self.get("EBUILD_PHASE") or \
123 self._use_wildcards or \
124 test_use_changed:
125 @@ -1962,6 +1963,63 @@
126 if has_changed:
127 self.reset(keeping_pkg=1,use_cache=use_cache)
128
129 + # Filter out USE flags that aren't part of IUSE. This has to
130 + # be done for every setcpv() call since practically every
131 + # package has different IUSE. Some flags are considered to
132 + # be implicit members of IUSE:
133 + #
134 + # * Flags derived from ARCH
135 + # * Flags derived from USE_EXPAND_HIDDEN variables
136 + # * Masked flags, such as those from {,package}use.mask
137 + # * Forced flags, such as those from {,package}use.force
138 + # * build and bootstrap flags used by bootstrap.sh
139 +
140 + usesplit = self["USE"].split()
141 + iuse_implicit = set(x.lstrip("+-") for x in iuse.split())
142 +
143 + # Flags derived from ARCH.
144 + arch = self.configdict["defaults"].get("ARCH")
145 + if arch:
146 + iuse_implicit.add(arch)
147 + iuse_implicit.update(self.get("PORTAGE_ARCHLIST", "").split())
148 +
149 + # Flags derived from USE_EXPAND_HIDDEN variables
150 + # such as ELIBC, KERNEL, and USERLAND.
151 + use_expand_hidden = self.get("USE_EXPAND_HIDDEN", "").split()
152 + use_expand_hidden_raw = use_expand_hidden
153 + if use_expand_hidden:
154 + use_expand_hidden = re.compile("^(%s)_.*" % \
155 + ("|".join(x.lower() for x in use_expand_hidden)))
156 + for x in usesplit:
157 + if use_expand_hidden.match(x):
158 + iuse_implicit.add(x)
159 +
160 + # Flags that have been masked or forced.
161 + iuse_implicit.update(self.usemask)
162 + iuse_implicit.update(self.useforce)
163 +
164 + # build and bootstrap flags used by bootstrap.sh
165 + iuse_implicit.add("build")
166 + iuse_implicit.add("bootstrap")
167 +
168 + if ebuild_phase:
169 + iuse_grep = iuse_implicit.copy()
170 + if use_expand_hidden_raw:
171 + for x in use_expand_hidden_raw:
172 + iuse_grep.add(x.lower() + "_.*")
173 + if iuse_grep:
174 + iuse_grep = "^(%s)$" % "|".join(sorted(iuse_grep))
175 + else:
176 + iuse_grep = ""
177 + self.configdict["pkg"]["PORTAGE_IUSE"] = iuse_grep
178 +
179 + # Filtered for the ebuild environment. Store this in a separate
180 + # attribute since we still want to be able to see global USE
181 + # settings for things like emerge --info.
182 + self.configdict["pkg"]["PORTAGE_USE"] = " ".join(sorted(
183 + x for x in usesplit if \
184 + x in iuse_implicit))
185 +
186 def _getMaskAtom(self, cpv, metadata):
187 """
188 Take a package and return a matching package.mask atom, or None if no
189 @@ -2109,7 +2167,7 @@
190 return
191 if isinstance(mydbapi, portdbapi):
192 self.setcpv(mycpv, mydb=mydbapi)
193 - myuse = self["USE"]
194 + myuse = self["PORTAGE_USE"]
195 elif isinstance(mydbapi, dict):
196 myuse = mydbapi["USE"]
197 else:
198 @@ -2395,64 +2453,9 @@
199 if arch and arch not in usesplit:
200 usesplit.append(arch)
201
202 - # Filter out USE flags that aren't part of IUSE. Some
203 - # flags are considered to be implicit members of IUSE:
204 - #
205 - # * Flags derived from ARCH
206 - # * Flags derived from USE_EXPAND_HIDDEN variables
207 - # * Masked flags, such as those from {,package}use.mask
208 - # * Forced flags, such as those from {,package}use.force
209 - # * build and bootstrap flags used by bootstrap.sh
210 -
211 - # Do this even when there's no package since setcpv() can
212 - # optimize away regenerate() calls.
213 - iuse_implicit = set(iuse)
214 -
215 - # Flags derived from ARCH.
216 - if arch:
217 - iuse_implicit.add(arch)
218 - iuse_implicit.update(self.get("PORTAGE_ARCHLIST", "").split())
219 -
220 - # Flags derived from USE_EXPAND_HIDDEN variables
221 - # such as ELIBC, KERNEL, and USERLAND.
222 - use_expand_hidden = self.get("USE_EXPAND_HIDDEN", "").split()
223 - use_expand_hidden_raw = use_expand_hidden
224 - if use_expand_hidden:
225 - use_expand_hidden = re.compile("^(%s)_.*" % \
226 - ("|".join(x.lower() for x in use_expand_hidden)))
227 - for x in usesplit:
228 - if use_expand_hidden.match(x):
229 - iuse_implicit.add(x)
230 -
231 - # Flags that have been masked or forced.
232 - iuse_implicit.update(self.usemask)
233 - iuse_implicit.update(self.useforce)
234 -
235 - # build and bootstrap flags used by bootstrap.sh
236 - iuse_implicit.add("build")
237 - iuse_implicit.add("bootstrap")
238 -
239 - iuse_grep = iuse_implicit.copy()
240 - if use_expand_hidden_raw:
241 - for x in use_expand_hidden_raw:
242 - iuse_grep.add(x.lower() + "_.*")
243 - if iuse_grep:
244 - iuse_grep = "^(%s)$" % "|".join(sorted(iuse_grep))
245 - else:
246 - iuse_grep = ""
247 - self["PORTAGE_IUSE"] = iuse_grep
248 -
249 usesplit = [x for x in usesplit if \
250 x not in self.usemask]
251
252 - # Filtered for the ebuild environment. Store this in a separate
253 - # attribute since we still want to be able to see global USE
254 - # settings for things like emerge --info.
255 - self["PORTAGE_USE"] = " ".join(sorted(
256 - x for x in usesplit if \
257 - x in iuse_implicit))
258 - self.backup_changes("PORTAGE_USE")
259 -
260 usesplit.sort()
261 self.configlist[-1]["USE"]= " ".join(usesplit)
262
263 @@ -2654,7 +2657,7 @@
264 mydict[k] = v
265
266 # Filtered by IUSE and implicit IUSE.
267 - mydict["USE"] = self["PORTAGE_USE"]
268 + mydict["USE"] = self.get("PORTAGE_USE", "")
269
270 # sandbox's bashrc sources /etc/profile which unsets ROOTPATH,
271 # so we have to back it up and restore it.
272 @@ -5372,7 +5375,7 @@
273 if use=="yes":
274 if myuse is None:
275 #default behavior
276 - myusesplit = mysettings["USE"].split()
277 + myusesplit = mysettings["PORTAGE_USE"].split()
278 else:
279 myusesplit = myuse
280 # We've been given useflags to use.
281
282 --
283 gentoo-commits@l.g.o mailing list