1 |
Author: grobian |
2 |
Date: 2010-02-04 19:09:17 +0000 (Thu, 04 Feb 2010) |
3 |
New Revision: 15320 |
4 |
|
5 |
Modified: |
6 |
main/branches/prefix/bin/dispatch-conf |
7 |
main/branches/prefix/bin/filter-bash-environment.py |
8 |
main/branches/prefix/bin/repoman |
9 |
main/branches/prefix/cnf/sets.conf |
10 |
main/branches/prefix/pym/_emerge/EbuildFetcher.py |
11 |
main/branches/prefix/pym/_emerge/create_world_atom.py |
12 |
main/branches/prefix/pym/_emerge/main.py |
13 |
main/branches/prefix/pym/portage/__init__.py |
14 |
main/branches/prefix/pym/portage/checksum.py |
15 |
main/branches/prefix/pym/portage/dbapi/__init__.py |
16 |
main/branches/prefix/pym/portage/dbapi/porttree.py |
17 |
main/branches/prefix/pym/portage/news.py |
18 |
main/branches/prefix/pym/portage/sets/__init__.py |
19 |
Log: |
20 |
Merged from trunk -r15303:15318 |
21 |
|
22 |
| 15304 | Bug #302937 - Handle declare -r without assignment. | |
23 |
| zmedico | | |
24 |
|
25 |
| 15305 | Validate categories. | |
26 |
| zmedico | | |
27 |
|
28 |
| 15306 | Deprecate pordbapi.mysettings since the portdbapi.settings | |
29 |
| zmedico | alias is now supported by stable portage. | |
30 |
|
31 |
| 15307 | Bug #298141 - Make /etc/portage/sets relative to | |
32 |
| zmedico | PORTAGE_CONFIGROOT. Thanks to Martin Gysel (bearsh) | |
33 |
| | <m.gysel@×××.ch> for this patch. | |
34 |
|
35 |
| 15308 | Fix @module-rebuild to support $ROOT. | |
36 |
| zmedico | | |
37 |
|
38 |
| 15309 | Clean up config incrementals handling. | |
39 |
| zmedico | | |
40 |
|
41 |
| 15310 | Simplify the conditional that triggers calculation of A and | |
42 |
| zmedico | AA variables. | |
43 |
|
44 |
| 15311 | Deallocate config instance when necessary, to avoid memory | |
45 |
| zmedico | leak when in prefetch mode. | |
46 |
|
47 |
| 15312 | Optimize parallel-fetch for the case where all files are | |
48 |
| zmedico | already fetched and have the correct size. In this case we | |
49 |
| | can avoid the expense of spawning ebuild(1). | |
50 |
|
51 |
| 15313 | Make sure the fetcher process correctly inherits | |
52 |
| zmedico | PORTAGE_CONFIGROOT. | |
53 |
|
54 |
| 15314 | Fix deprecated portdbapi.mysettings reference. | |
55 |
| zmedico | | |
56 |
|
57 |
| 15315 | Use stat rather than lstat since portage.fetch() creates | |
58 |
| zmedico | symlinks when PORTAGE_RO_DISTDIRS is used. | |
59 |
|
60 |
| 15316 | Use Package.use.enabled where appropriate. | |
61 |
| zmedico | | |
62 |
|
63 |
| 15317 | Bug #295197 - Output a newline after valid user input is | |
64 |
| zmedico | received. | |
65 |
|
66 |
| 15318 | Make verify_all() do checksums in sorted order by hash name. | |
67 |
| zmedico | | |
68 |
|
69 |
|
70 |
Modified: main/branches/prefix/bin/dispatch-conf |
71 |
=================================================================== |
72 |
--- main/branches/prefix/bin/dispatch-conf 2010-02-04 19:03:41 UTC (rev 15319) |
73 |
+++ main/branches/prefix/bin/dispatch-conf 2010-02-04 19:09:17 UTC (rev 15320) |
74 |
@@ -248,6 +248,8 @@ |
75 |
while True: |
76 |
c = getch() |
77 |
if c in valid_input: |
78 |
+ sys.stdout.write('\n') |
79 |
+ sys.stdout.flush() |
80 |
break |
81 |
|
82 |
if c == 'q': |
83 |
|
84 |
Modified: main/branches/prefix/bin/filter-bash-environment.py |
85 |
=================================================================== |
86 |
--- main/branches/prefix/bin/filter-bash-environment.py 2010-02-04 19:03:41 UTC (rev 15319) |
87 |
+++ main/branches/prefix/bin/filter-bash-environment.py 2010-02-04 19:09:17 UTC (rev 15320) |
88 |
@@ -13,6 +13,8 @@ |
89 |
var_assign_re = re.compile(r'(^|^declare\s+-\S+\s+|^declare\s+|^export\s+)([^=\s]+)=("|\')?.*$') |
90 |
close_quote_re = re.compile(r'(\\"|"|\')\s*$') |
91 |
readonly_re = re.compile(r'^declare\s+-(\S*)r(\S*)\s+') |
92 |
+# declare without assignment |
93 |
+var_declare_re = re.compile(r'^declare(\s+-\S+)?\s+([^=\s]+)\s*$') |
94 |
|
95 |
def have_end_quote(quote, line): |
96 |
""" |
97 |
@@ -25,6 +27,21 @@ |
98 |
return close_quote_match is not None and \ |
99 |
close_quote_match.group(1) == quote |
100 |
|
101 |
+def filter_declare_readonly_opt(line): |
102 |
+ readonly_match = readonly_re.match(line) |
103 |
+ if readonly_match is not None: |
104 |
+ declare_opts = '' |
105 |
+ for i in (1, 2): |
106 |
+ group = readonly_match.group(i) |
107 |
+ if group is not None: |
108 |
+ declare_opts += group |
109 |
+ if declare_opts: |
110 |
+ line = 'declare -%s %s' % \ |
111 |
+ (declare_opts, line[readonly_match.end():]) |
112 |
+ else: |
113 |
+ line = 'declare ' + line[readonly_match.end():] |
114 |
+ return line |
115 |
+ |
116 |
def filter_bash_environment(pattern, file_in, file_out): |
117 |
# Filter out any instances of the \1 character from variable values |
118 |
# since this character multiplies each time that the environment |
119 |
@@ -58,20 +75,20 @@ |
120 |
multi_line_quote = quote |
121 |
multi_line_quote_filter = filter_this |
122 |
if not filter_this: |
123 |
- readonly_match = readonly_re.match(line) |
124 |
- if readonly_match is not None: |
125 |
- declare_opts = "" |
126 |
- for i in (1, 2): |
127 |
- group = readonly_match.group(i) |
128 |
- if group is not None: |
129 |
- declare_opts += group |
130 |
- if declare_opts: |
131 |
- line = "declare -%s %s" % \ |
132 |
- (declare_opts, line[readonly_match.end():]) |
133 |
- else: |
134 |
- line = "declare " + line[readonly_match.end():] |
135 |
+ line = filter_declare_readonly_opt(line) |
136 |
file_out.write(line.replace("\1", "")) |
137 |
continue |
138 |
+ else: |
139 |
+ declare_match = var_declare_re.match(line) |
140 |
+ if declare_match is not None: |
141 |
+ # declare without assignment |
142 |
+ filter_this = pattern.match(declare_match.group(2)) \ |
143 |
+ is not None |
144 |
+ if not filter_this: |
145 |
+ line = filter_declare_readonly_opt(line) |
146 |
+ file_out.write(line) |
147 |
+ continue |
148 |
+ |
149 |
if here_doc_delim is not None: |
150 |
if here_doc_delim.match(line): |
151 |
here_doc_delim = None |
152 |
|
153 |
Modified: main/branches/prefix/bin/repoman |
154 |
=================================================================== |
155 |
--- main/branches/prefix/bin/repoman 2010-02-04 19:03:41 UTC (rev 15319) |
156 |
+++ main/branches/prefix/bin/repoman 2010-02-04 19:09:17 UTC (rev 15320) |
157 |
@@ -89,8 +89,11 @@ |
158 |
|
159 |
# A sane umask is needed for files that portage creates. |
160 |
os.umask(0o22) |
161 |
-repoman_settings = portage.config(local_config=False, |
162 |
- config_incrementals=portage.const.INCREMENTALS) |
163 |
+# Repoman sets it's own ACCEPT_KEYWORDS and we don't want it to |
164 |
+# behave incrementally. |
165 |
+repoman_incrementals = tuple(x for x in \ |
166 |
+ portage.const.INCREMENTALS if x != 'ACCEPT_KEYWORDS') |
167 |
+repoman_settings = portage.config(local_config=False) |
168 |
repoman_settings.lock() |
169 |
|
170 |
if repoman_settings.get("NOCOLOR", "").lower() in ("yes", "true") or \ |
171 |
@@ -557,7 +560,7 @@ |
172 |
portage.util.stack_lists([categories], incremental=1))) |
173 |
del categories |
174 |
|
175 |
-portdb.mysettings = repoman_settings |
176 |
+portdb.settings = repoman_settings |
177 |
root_config = RootConfig(repoman_settings, trees[root], None) |
178 |
# We really only need to cache the metadata that's necessary for visibility |
179 |
# filtering. Anything else can be discarded to reduce memory consumption. |
180 |
@@ -1749,19 +1752,12 @@ |
181 |
if dep_settings is None: |
182 |
dep_settings = portage.config( |
183 |
config_profile_path=prof.abs_path, |
184 |
- config_incrementals=portage.const.INCREMENTALS, |
185 |
+ config_incrementals=repoman_incrementals, |
186 |
local_config=False, |
187 |
env=env) |
188 |
if options.without_mask: |
189 |
dep_settings.pmaskdict.clear() |
190 |
arch_caches[prof.sub_path] = dep_settings |
191 |
- while True: |
192 |
- try: |
193 |
- # Protect ACCEPT_KEYWORDS from config.regenerate() |
194 |
- # (just in case) |
195 |
- dep_settings.incrementals.remove("ACCEPT_KEYWORDS") |
196 |
- except ValueError: |
197 |
- break |
198 |
|
199 |
xmatch_cache_key = (prof.sub_path, tuple(groups)) |
200 |
xcache = arch_xmatch_caches.get(xmatch_cache_key) |
201 |
@@ -1773,7 +1769,7 @@ |
202 |
arch_xmatch_caches[xmatch_cache_key] = xcache |
203 |
|
204 |
trees["/"]["porttree"].settings = dep_settings |
205 |
- portdb.mysettings = dep_settings |
206 |
+ portdb.settings = dep_settings |
207 |
portdb.xcache = xcache |
208 |
# for package.use.mask support inside dep_check |
209 |
dep_settings.setcpv(pkg) |
210 |
|
211 |
Modified: main/branches/prefix/cnf/sets.conf |
212 |
=================================================================== |
213 |
--- main/branches/prefix/cnf/sets.conf 2010-02-04 19:03:41 UTC (rev 15319) |
214 |
+++ main/branches/prefix/cnf/sets.conf 2010-02-04 19:09:17 UTC (rev 15320) |
215 |
@@ -44,7 +44,7 @@ |
216 |
[usersets] |
217 |
class = portage.sets.files.StaticFileSet |
218 |
multiset = true |
219 |
-directory = @PORTAGE_EPREFIX@/etc/portage/sets |
220 |
+directory = %(PORTAGE_CONFIGROOT)setc/portage/sets |
221 |
|
222 |
# Set to rebuild all packages that need a preserved lib that only remains due |
223 |
# to FEATURES=preserve-libs |
224 |
@@ -63,7 +63,7 @@ |
225 |
[module-rebuild] |
226 |
class = portage.sets.dbapi.OwnerSet |
227 |
world-candidate = False |
228 |
-files = /lib/modules |
229 |
+files = %(ROOT)slib/modules |
230 |
|
231 |
# Installed packages for which the highest visible ebuild |
232 |
# version is lower than the currently installed version. |
233 |
|
234 |
Modified: main/branches/prefix/pym/_emerge/EbuildFetcher.py |
235 |
=================================================================== |
236 |
--- main/branches/prefix/pym/_emerge/EbuildFetcher.py 2010-02-04 19:03:41 UTC (rev 15319) |
237 |
+++ main/branches/prefix/pym/_emerge/EbuildFetcher.py 2010-02-04 19:09:17 UTC (rev 15320) |
238 |
@@ -28,6 +28,12 @@ |
239 |
raise AssertionError("ebuild not found for '%s'" % self.pkg.cpv) |
240 |
settings = self.config_pool.allocate() |
241 |
settings.setcpv(self.pkg) |
242 |
+ if self.prefetch and \ |
243 |
+ self._prefetch_size_ok(portdb, settings, ebuild_path): |
244 |
+ self.config_pool.deallocate(settings) |
245 |
+ self.returncode = os.EX_OK |
246 |
+ self.wait() |
247 |
+ return |
248 |
|
249 |
# In prefetch mode, logging goes to emerge-fetch.log and the builddir |
250 |
# should not be touched since otherwise it could interfere with |
251 |
@@ -51,6 +57,7 @@ |
252 |
# along here so that they are correctly considered by |
253 |
# the config instance in the subproccess. |
254 |
fetch_env = os.environ.copy() |
255 |
+ fetch_env['PORTAGE_CONFIGROOT'] = settings['PORTAGE_CONFIGROOT'] |
256 |
|
257 |
nocolor = settings.get("NOCOLOR") |
258 |
if nocolor is not None: |
259 |
@@ -75,8 +82,59 @@ |
260 |
|
261 |
self.args = fetch_args |
262 |
self.env = fetch_env |
263 |
+ if self._build_dir is None: |
264 |
+ # Free settings now since we only have a local reference. |
265 |
+ self.config_pool.deallocate(settings) |
266 |
SpawnProcess._start(self) |
267 |
|
268 |
+ def _prefetch_size_ok(self, portdb, settings, ebuild_path): |
269 |
+ pkgdir = os.path.dirname(ebuild_path) |
270 |
+ mytree = os.path.dirname(os.path.dirname(pkgdir)) |
271 |
+ distdir = settings["DISTDIR"] |
272 |
+ use = None |
273 |
+ if not self.fetchall: |
274 |
+ use = self.pkg.use.enabled |
275 |
+ |
276 |
+ try: |
277 |
+ uri_map = portdb.getFetchMap(self.pkg.cpv, |
278 |
+ useflags=use, mytree=mytree) |
279 |
+ except portage.exception.InvalidDependString as e: |
280 |
+ return False |
281 |
+ |
282 |
+ sizes = {} |
283 |
+ for filename in uri_map: |
284 |
+ # Use stat rather than lstat since portage.fetch() creates |
285 |
+ # symlinks when PORTAGE_RO_DISTDIRS is used. |
286 |
+ try: |
287 |
+ st = os.stat(os.path.join(distdir, filename)) |
288 |
+ except OSError: |
289 |
+ return False |
290 |
+ if st.st_size == 0: |
291 |
+ return False |
292 |
+ sizes[filename] = st.st_size |
293 |
+ |
294 |
+ digests = portage.Manifest(pkgdir, distdir).getTypeDigests("DIST") |
295 |
+ for filename, actual_size in sizes.items(): |
296 |
+ size = digests.get(filename, {}).get('size') |
297 |
+ if size is None: |
298 |
+ continue |
299 |
+ if size != actual_size: |
300 |
+ return False |
301 |
+ |
302 |
+ # All files are present and sizes are ok. In this case the normal |
303 |
+ # fetch code will be skipped, so we need to generate equivalent |
304 |
+ # output here. |
305 |
+ if self.logfile is not None: |
306 |
+ f = codecs.open(_unicode_encode(self.logfile, |
307 |
+ encoding=_encodings['fs'], errors='strict'), |
308 |
+ mode='a', encoding=_encodings['content'], errors='replace') |
309 |
+ for filename in uri_map: |
310 |
+ f.write((' * %s size ;-) ...' % \ |
311 |
+ filename).ljust(73) + '[ ok ]\n') |
312 |
+ f.close() |
313 |
+ |
314 |
+ return True |
315 |
+ |
316 |
def _pipe(self, fd_pipes): |
317 |
"""When appropriate, use a pty so that fetcher progress bars, |
318 |
like wget has, will work properly.""" |
319 |
|
320 |
Modified: main/branches/prefix/pym/_emerge/create_world_atom.py |
321 |
=================================================================== |
322 |
--- main/branches/prefix/pym/_emerge/create_world_atom.py 2010-02-04 19:03:41 UTC (rev 15319) |
323 |
+++ main/branches/prefix/pym/_emerge/create_world_atom.py 2010-02-04 19:09:17 UTC (rev 15320) |
324 |
@@ -81,7 +81,7 @@ |
325 |
# System virtuals aren't safe to exclude from world since they can |
326 |
# match multiple old-style virtuals but only one of them will be |
327 |
# pulled in by update or depclean. |
328 |
- providers = portdb.mysettings.getvirtuals().get( |
329 |
+ providers = portdb.settings.getvirtuals().get( |
330 |
portage.dep_getkey(system_atom)) |
331 |
if providers and len(providers) == 1 and \ |
332 |
portage.dep_getkey(providers[0]) == cp: |
333 |
|
334 |
Modified: main/branches/prefix/pym/_emerge/main.py |
335 |
=================================================================== |
336 |
--- main/branches/prefix/pym/_emerge/main.py 2010-02-04 19:03:41 UTC (rev 15319) |
337 |
+++ main/branches/prefix/pym/_emerge/main.py 2010-02-04 19:09:17 UTC (rev 15320) |
338 |
@@ -1081,7 +1081,7 @@ |
339 |
for root, root_trees in trees.items(): |
340 |
if 'porttree' in root_trees: |
341 |
portdb = root_trees['porttree'].dbapi |
342 |
- if portdb.mysettings.get('PORTAGE_REPO_DUPLICATE_WARN') != '0': |
343 |
+ if portdb.settings.get('PORTAGE_REPO_DUPLICATE_WARN') != '0': |
344 |
for repo_name, paths in portdb._ignored_repos: |
345 |
k = (root, repo_name, portdb.getRepositoryPath(repo_name)) |
346 |
ignored_repos.setdefault(k, []).extend(paths) |
347 |
|
348 |
Modified: main/branches/prefix/pym/portage/__init__.py |
349 |
=================================================================== |
350 |
--- main/branches/prefix/pym/portage/__init__.py 2010-02-04 19:03:41 UTC (rev 15319) |
351 |
+++ main/branches/prefix/pym/portage/__init__.py 2010-02-04 19:09:17 UTC (rev 15320) |
352 |
@@ -2124,7 +2124,8 @@ |
353 |
#getting categories from an external file now |
354 |
categories = [grabfile(os.path.join(x, "categories")) for x in locations] |
355 |
self.categories = tuple(sorted( |
356 |
- stack_lists(categories, incremental=1))) |
357 |
+ x for x in stack_lists(categories, incremental=1) |
358 |
+ if dbapi._category_re.match(x) is not None)) |
359 |
del categories |
360 |
|
361 |
archlist = [grabfile(os.path.join(x, "arch.list")) for x in locations] |
362 |
@@ -7211,7 +7212,7 @@ |
363 |
mydo not in ("digest", "manifest") and "noauto" not in features) |
364 |
alist = mysettings.configdict["pkg"].get("A") |
365 |
aalist = mysettings.configdict["pkg"].get("AA") |
366 |
- if need_distfiles or alist is None or aalist is None: |
367 |
+ if alist is None or aalist is None: |
368 |
# Make sure we get the correct tree in case there are overlays. |
369 |
mytree = os.path.realpath( |
370 |
os.path.dirname(os.path.dirname(mysettings["O"]))) |
371 |
|
372 |
Modified: main/branches/prefix/pym/portage/checksum.py |
373 |
=================================================================== |
374 |
--- main/branches/prefix/pym/portage/checksum.py 2010-02-04 19:03:41 UTC (rev 15319) |
375 |
+++ main/branches/prefix/pym/portage/checksum.py 2010-02-04 19:09:17 UTC (rev 15320) |
376 |
@@ -186,7 +186,7 @@ |
377 |
got = " ".join(got) |
378 |
return False, (_("Insufficient data for checksum verification"), got, expected) |
379 |
|
380 |
- for x in mydict: |
381 |
+ for x in sorted(mydict): |
382 |
if x == "size": |
383 |
continue |
384 |
elif x in hashfunc_map: |
385 |
|
386 |
Modified: main/branches/prefix/pym/portage/dbapi/__init__.py |
387 |
=================================================================== |
388 |
--- main/branches/prefix/pym/portage/dbapi/__init__.py 2010-02-04 19:03:41 UTC (rev 15319) |
389 |
+++ main/branches/prefix/pym/portage/dbapi/__init__.py 2010-02-04 19:09:17 UTC (rev 15320) |
390 |
@@ -171,7 +171,7 @@ |
391 |
continue |
392 |
else: |
393 |
# Check masked and forced flags for repoman. |
394 |
- mysettings = getattr(self, "mysettings", None) |
395 |
+ mysettings = getattr(self, 'settings', None) |
396 |
if mysettings is not None and not mysettings.local_config: |
397 |
|
398 |
pkg = "%s:%s" % (cpv, slot) |
399 |
|
400 |
Modified: main/branches/prefix/pym/portage/dbapi/porttree.py |
401 |
=================================================================== |
402 |
--- main/branches/prefix/pym/portage/dbapi/porttree.py 2010-02-04 19:03:41 UTC (rev 15319) |
403 |
+++ main/branches/prefix/pym/portage/dbapi/porttree.py 2010-02-04 19:09:17 UTC (rev 15320) |
404 |
@@ -125,17 +125,22 @@ |
405 |
_use_mutable = True |
406 |
|
407 |
def _get_settings(self): |
408 |
- return self.mysettings |
409 |
+ warnings.warn("Use portdbapi.settings insead of portdbapi.mysettings", |
410 |
+ DeprecationWarning) |
411 |
+ return self.settings |
412 |
|
413 |
def _set_settings(self, settings): |
414 |
- self.mysettings = settings |
415 |
+ warnings.warn("Use portdbapi.settings insead of portdbapi.mysettings", |
416 |
+ DeprecationWarning) |
417 |
+ self.settings = settings |
418 |
|
419 |
def _del_settings (self): |
420 |
- del self.mysettings |
421 |
+ warnings.warn("Use portdbapi.settings insead of portdbapi.mysettings", |
422 |
+ DeprecationWarning) |
423 |
+ del self.settings |
424 |
|
425 |
- settings = property(_get_settings, _set_settings, _del_settings, |
426 |
- "Define self.settings as an alias for self.mysettings, " + \ |
427 |
- "for conformity with other dbapi classes.") |
428 |
+ mysettings = property(_get_settings, _set_settings, _del_settings, |
429 |
+ "Deprecated self.mysettings, only for backward compatibility") |
430 |
|
431 |
@property |
432 |
def _categories(self): |
433 |
@@ -152,12 +157,12 @@ |
434 |
|
435 |
from portage import config |
436 |
if mysettings: |
437 |
- self.mysettings = mysettings |
438 |
+ self.settings = mysettings |
439 |
else: |
440 |
from portage import settings |
441 |
- self.mysettings = config(clone=settings) |
442 |
+ self.settings = config(clone=settings) |
443 |
|
444 |
- porttree_root = self.mysettings['PORTDIR'] |
445 |
+ porttree_root = self.settings['PORTDIR'] |
446 |
|
447 |
# always show this warning after this parameter |
448 |
# is unused in stable portage |
449 |
@@ -172,8 +177,8 @@ |
450 |
# is generated by the depend phase. It's safest to use a clone for |
451 |
# this purpose because doebuild makes many changes to the config |
452 |
# instance that is passed in. |
453 |
- self.doebuild_settings = config(clone=self.mysettings) |
454 |
- self.depcachedir = os.path.realpath(self.mysettings.depcachedir) |
455 |
+ self.doebuild_settings = config(clone=self.settings) |
456 |
+ self.depcachedir = os.path.realpath(self.settings.depcachedir) |
457 |
|
458 |
if os.environ.get("SANDBOX_ON") == "1": |
459 |
# Make api consumers exempt from sandbox violations |
460 |
@@ -186,7 +191,7 @@ |
461 |
|
462 |
porttrees = [os.path.realpath(porttree_root)] |
463 |
porttrees.extend(os.path.realpath(x) for x in \ |
464 |
- self.mysettings.get('PORTDIR_OVERLAY', '').split()) |
465 |
+ self.settings.get('PORTDIR_OVERLAY', '').split()) |
466 |
treemap = {} |
467 |
repository_map = {} |
468 |
self.treemap = treemap |
469 |
@@ -242,7 +247,7 @@ |
470 |
self._have_root_eclass_dir = os.path.isdir( |
471 |
os.path.join(self.porttree_root, "eclass")) |
472 |
|
473 |
- self.metadbmodule = self.mysettings.load_best_module("portdbapi.metadbmodule") |
474 |
+ self.metadbmodule = self.settings.load_best_module("portdbapi.metadbmodule") |
475 |
|
476 |
#if the portdbapi is "frozen", then we assume that we can cache everything (that no updates to it are happening) |
477 |
self.xcache = {} |
478 |
@@ -250,7 +255,7 @@ |
479 |
|
480 |
self._repo_info = {} |
481 |
eclass_dbs = {porttree_root : self.eclassdb} |
482 |
- local_repo_configs = self.mysettings._local_repo_configs |
483 |
+ local_repo_configs = self.settings._local_repo_configs |
484 |
default_loc_repo_config = None |
485 |
repo_aliases = {} |
486 |
if local_repo_configs is not None: |
487 |
@@ -265,7 +270,7 @@ |
488 |
"'%s' alias in " \ |
489 |
"'%s'\n") % (alias, repo_name, |
490 |
overridden_alias, |
491 |
- self.mysettings._local_repo_conf_path), |
492 |
+ self.settings._local_repo_conf_path), |
493 |
level=logging.WARNING, noiselevel=-1) |
494 |
repo_aliases[alias] = repo_name |
495 |
|
496 |
@@ -324,7 +329,7 @@ |
497 |
writemsg_level(_("Unavailable repository '%s' " \ |
498 |
"referenced by eclass-overrides entry in " \ |
499 |
"'%s'\n") % (other_name, |
500 |
- self.mysettings._local_repo_conf_path), |
501 |
+ self.settings._local_repo_conf_path), |
502 |
level=logging.ERROR, noiselevel=-1) |
503 |
continue |
504 |
porttrees.append(other_path) |
505 |
@@ -342,7 +347,7 @@ |
506 |
|
507 |
self._repo_info[path] = _repo_info(repo_name, path, eclass_db) |
508 |
|
509 |
- self.auxdbmodule = self.mysettings.load_best_module("portdbapi.auxdbmodule") |
510 |
+ self.auxdbmodule = self.settings.load_best_module("portdbapi.auxdbmodule") |
511 |
self.auxdb = {} |
512 |
self._pregen_auxdb = {} |
513 |
self._init_cache_dirs() |
514 |
@@ -379,7 +384,7 @@ |
515 |
self.depcachedir, x, filtered_auxdbkeys, **cache_kwargs) |
516 |
if self.auxdbmodule is metadata_overlay.database: |
517 |
self.auxdb[x].db_ro.ec = self._repo_info[x].eclass_db |
518 |
- if "metadata-transfer" not in self.mysettings.features: |
519 |
+ if "metadata-transfer" not in self.settings.features: |
520 |
for x in self.porttrees: |
521 |
if x in self._pregen_auxdb: |
522 |
continue |
523 |
@@ -806,7 +811,7 @@ |
524 |
if myebuild is None: |
525 |
raise AssertionError("ebuild not found for '%s'" % mypkg) |
526 |
pkgdir = os.path.dirname(myebuild) |
527 |
- mf = Manifest(pkgdir, self.mysettings["DISTDIR"]) |
528 |
+ mf = Manifest(pkgdir, self.settings["DISTDIR"]) |
529 |
checksums = mf.getDigests() |
530 |
if not checksums: |
531 |
if debug: |
532 |
@@ -821,7 +826,7 @@ |
533 |
if debug: |
534 |
writemsg(_("[bad digest]: missing %(file)s for %(pkg)s\n") % {"file":myfile, "pkg":mypkg}) |
535 |
continue |
536 |
- file_path = os.path.join(self.mysettings["DISTDIR"], myfile) |
537 |
+ file_path = os.path.join(self.settings["DISTDIR"], myfile) |
538 |
mystat = None |
539 |
try: |
540 |
mystat = os.stat(file_path) |
541 |
@@ -851,7 +856,7 @@ |
542 |
if myebuild is None: |
543 |
raise AssertionError("ebuild not found for '%s'" % mypkg) |
544 |
pkgdir = os.path.dirname(myebuild) |
545 |
- mf = Manifest(pkgdir, self.mysettings["DISTDIR"]) |
546 |
+ mf = Manifest(pkgdir, self.settings["DISTDIR"]) |
547 |
mysums = mf.getDigests() |
548 |
|
549 |
failures = {} |
550 |
@@ -862,7 +867,7 @@ |
551 |
else: |
552 |
try: |
553 |
ok, reason = portage.checksum.verify_all( |
554 |
- os.path.join(self.mysettings["DISTDIR"], x), mysums[x]) |
555 |
+ os.path.join(self.settings["DISTDIR"], x), mysums[x]) |
556 |
except FileNotFound as e: |
557 |
ok = False |
558 |
reason = _("File Not Found: '%s'") % (e,) |
559 |
@@ -887,7 +892,7 @@ |
560 |
def cp_all(self): |
561 |
"returns a list of all keys in our tree" |
562 |
d = {} |
563 |
- for x in self.mysettings.categories: |
564 |
+ for x in self.settings.categories: |
565 |
for oroot in self.porttrees: |
566 |
for y in listdir(oroot+"/"+x, EmptyOnError=1, ignorecvs=1, dirsonly=1): |
567 |
if not self._pkg_dir_name_re.match(y) or \ |
568 |
@@ -948,7 +953,7 @@ |
569 |
if invalid_category and d: |
570 |
writemsg(_("\n!!! '%s' has a category that is not listed in " \ |
571 |
"%setc/portage/categories\n") % \ |
572 |
- (mycp, self.mysettings["PORTAGE_CONFIGROOT"]), noiselevel=-1) |
573 |
+ (mycp, self.settings["PORTAGE_CONFIGROOT"]), noiselevel=-1) |
574 |
mylist = [] |
575 |
else: |
576 |
mylist = list(d) |
577 |
@@ -986,7 +991,7 @@ |
578 |
if not mydep: |
579 |
#this stuff only runs on first call of xmatch() |
580 |
#create mydep, mykey from origdep |
581 |
- mydep = dep_expand(origdep, mydb=self, settings=self.mysettings) |
582 |
+ mydep = dep_expand(origdep, mydb=self, settings=self.settings) |
583 |
mykey = mydep.cp |
584 |
|
585 |
if level == "list-visible": |
586 |
@@ -1015,7 +1020,7 @@ |
587 |
else: |
588 |
mylist = match_from_list(mydep, self.cp_list(mykey)) |
589 |
myval = "" |
590 |
- settings = self.mysettings |
591 |
+ settings = self.settings |
592 |
local_config = settings.local_config |
593 |
aux_keys = list(self._aux_cache_keys) |
594 |
if level == "minimum-visible": |
595 |
@@ -1102,8 +1107,8 @@ |
596 |
|
597 |
db_keys = ["SLOT"] |
598 |
visible = [] |
599 |
- getMaskAtom = self.mysettings._getMaskAtom |
600 |
- getProfileMaskAtom = self.mysettings._getProfileMaskAtom |
601 |
+ getMaskAtom = self.settings._getMaskAtom |
602 |
+ getProfileMaskAtom = self.settings._getProfileMaskAtom |
603 |
for cpv in mylist: |
604 |
try: |
605 |
metadata = dict(zip(db_keys, self.aux_get(cpv, db_keys))) |
606 |
@@ -1127,9 +1132,9 @@ |
607 |
newlist=[] |
608 |
aux_keys = list(self._aux_cache_keys) |
609 |
metadata = {} |
610 |
- local_config = self.mysettings.local_config |
611 |
- chost = self.mysettings.get('CHOST', '') |
612 |
- accept_chost = self.mysettings._accept_chost |
613 |
+ local_config = self.settings.local_config |
614 |
+ chost = self.settings.get('CHOST', '') |
615 |
+ accept_chost = self.settings._accept_chost |
616 |
for mycpv in mylist: |
617 |
metadata.clear() |
618 |
try: |
619 |
@@ -1147,7 +1152,7 @@ |
620 |
continue |
621 |
if _eapi_is_deprecated(eapi): |
622 |
continue |
623 |
- if self.mysettings._getMissingKeywords(mycpv, metadata): |
624 |
+ if self.settings._getMissingKeywords(mycpv, metadata): |
625 |
continue |
626 |
if local_config: |
627 |
metadata['CHOST'] = chost |
628 |
@@ -1158,9 +1163,9 @@ |
629 |
self.doebuild_settings.setcpv(mycpv, mydb=metadata) |
630 |
metadata['USE'] = self.doebuild_settings['PORTAGE_USE'] |
631 |
try: |
632 |
- if self.mysettings._getMissingLicenses(mycpv, metadata): |
633 |
+ if self.settings._getMissingLicenses(mycpv, metadata): |
634 |
continue |
635 |
- if self.mysettings._getMissingProperties(mycpv, metadata): |
636 |
+ if self.settings._getMissingProperties(mycpv, metadata): |
637 |
continue |
638 |
except InvalidDependString: |
639 |
continue |
640 |
|
641 |
Modified: main/branches/prefix/pym/portage/news.py |
642 |
=================================================================== |
643 |
--- main/branches/prefix/pym/portage/news.py 2010-02-04 19:03:41 UTC (rev 15319) |
644 |
+++ main/branches/prefix/pym/portage/news.py 2010-02-04 19:09:17 UTC (rev 15320) |
645 |
@@ -59,9 +59,9 @@ |
646 |
portdir = portdb.porttree_root |
647 |
profiles_base = os.path.join(portdir, 'profiles') + os.path.sep |
648 |
profile_path = None |
649 |
- if portdb.mysettings.profile_path: |
650 |
+ if portdb.settings.profile_path: |
651 |
profile_path = normalize_path( |
652 |
- os.path.realpath(portdb.mysettings.profile_path)) |
653 |
+ os.path.realpath(portdb.settings.profile_path)) |
654 |
if profile_path.startswith(profiles_base): |
655 |
profile_path = profile_path[len(profiles_base):] |
656 |
self._profile_path = profile_path |
657 |
|
658 |
Modified: main/branches/prefix/pym/portage/sets/__init__.py |
659 |
=================================================================== |
660 |
--- main/branches/prefix/pym/portage/sets/__init__.py 2010-02-04 19:03:41 UTC (rev 15319) |
661 |
+++ main/branches/prefix/pym/portage/sets/__init__.py 2010-02-04 19:09:17 UTC (rev 15320) |
662 |
@@ -34,7 +34,11 @@ |
663 |
|
664 |
class SetConfig(object): |
665 |
def __init__(self, paths, settings, trees): |
666 |
- self._parser = SafeConfigParser() |
667 |
+ self._parser = SafeConfigParser( |
668 |
+ defaults={ |
669 |
+ "PORTAGE_CONFIGROOT" : settings["PORTAGE_CONFIGROOT"], |
670 |
+ "ROOT" : settings["ROOT"], |
671 |
+ }) |
672 |
self._parser.read(paths) |
673 |
self.errors = [] |
674 |
self.psets = {} |