Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: bin/
Date: Sat, 30 Nov 2013 04:22:15
Message-Id: 1385768840.b004f54da09febe1e77a03d1e9ec633aa80d4557.vapier@gentoo
1 commit: b004f54da09febe1e77a03d1e9ec633aa80d4557
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Fri Nov 29 23:29:40 2013 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Fri Nov 29 23:47:20 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b004f54d
7
8 fix random pylint errors
9
10 Shouldn't be any functional changes here.
11
12 ---
13 bin/ebuild | 4 +-
14 bin/egencache | 124 +++++++++++++--------------
15 bin/emaint | 4 +-
16 bin/emerge | 4 +-
17 bin/portageq | 48 +++++------
18 bin/repoman | 266 +++++++++++++++++++++++++++++-----------------------------
19 6 files changed, 225 insertions(+), 225 deletions(-)
20
21 diff --git a/bin/ebuild b/bin/ebuild
22 index a100657..f8ac5b8 100755
23 --- a/bin/ebuild
24 +++ b/bin/ebuild
25 @@ -10,7 +10,7 @@ import sys
26 # This block ensures that ^C interrupts are handled quietly.
27 try:
28
29 - def exithandler(signum,frame):
30 + def exithandler(signum, _frame):
31 signal.signal(signal.SIGINT, signal.SIG_IGN)
32 signal.signal(signal.SIGTERM, signal.SIG_IGN)
33 sys.exit(128 + signum)
34 @@ -24,7 +24,7 @@ try:
35 except KeyboardInterrupt:
36 sys.exit(128 + signal.SIGINT)
37
38 -def debug_signal(signum, frame):
39 +def debug_signal(_signum, _frame):
40 import pdb
41 pdb.set_trace()
42
43
44 diff --git a/bin/egencache b/bin/egencache
45 index 915adc8..408aec8 100755
46 --- a/bin/egencache
47 +++ b/bin/egencache
48 @@ -11,7 +11,7 @@ import sys
49 # This block ensures that ^C interrupts are handled quietly.
50 try:
51
52 - def exithandler(signum,frame):
53 + def exithandler(signum, _frame):
54 signal.signal(signal.SIGINT, signal.SIG_IGN)
55 signal.signal(signal.SIGTERM, signal.SIG_IGN)
56 sys.exit(128 + signum)
57 @@ -22,7 +22,7 @@ try:
58 except KeyboardInterrupt:
59 sys.exit(128 + signal.SIGINT)
60
61 -def debug_signal(signum, frame):
62 +def debug_signal(_signum, _frame):
63 import pdb
64 pdb.set_trace()
65
66 @@ -74,6 +74,7 @@ else:
67 from repoman.utilities import FindVCS
68
69 if sys.hexversion >= 0x3000000:
70 + # pylint: disable=W0622
71 long = int
72
73 def parse_args(args):
74 @@ -300,69 +301,69 @@ class GenCache(object):
75
76 def _write_cache(self, trg_cache, cpv, repo_path, metadata, ebuild_hash):
77
78 - if not hasattr(trg_cache, 'raise_stat_collision'):
79 - # This cache does not avoid redundant writes automatically,
80 - # so check for an identical existing entry before writing.
81 - # This prevents unnecessary disk writes and can also prevent
82 - # unnecessary rsync transfers.
83 - try:
84 - dest = trg_cache[cpv]
85 - except (KeyError, CacheError):
86 - pass
87 - else:
88 - if trg_cache.validate_entry(dest,
89 - ebuild_hash, self._eclass_db):
90 - identical = True
91 - for k in self._auxdbkeys:
92 - if dest.get(k, '') != metadata.get(k, ''):
93 - identical = False
94 - break
95 - if identical:
96 - return
97 + if not hasattr(trg_cache, 'raise_stat_collision'):
98 + # This cache does not avoid redundant writes automatically,
99 + # so check for an identical existing entry before writing.
100 + # This prevents unnecessary disk writes and can also prevent
101 + # unnecessary rsync transfers.
102 + try:
103 + dest = trg_cache[cpv]
104 + except (KeyError, CacheError):
105 + pass
106 + else:
107 + if trg_cache.validate_entry(dest,
108 + ebuild_hash, self._eclass_db):
109 + identical = True
110 + for k in self._auxdbkeys:
111 + if dest.get(k, '') != metadata.get(k, ''):
112 + identical = False
113 + break
114 + if identical:
115 + return
116
117 + try:
118 + chf = trg_cache.validation_chf
119 + metadata['_%s_' % chf] = getattr(ebuild_hash, chf)
120 try:
121 - chf = trg_cache.validation_chf
122 - metadata['_%s_' % chf] = getattr(ebuild_hash, chf)
123 + trg_cache[cpv] = metadata
124 + except StatCollision as sc:
125 + # If the content of a cache entry changes and neither the
126 + # file mtime nor size changes, it will prevent rsync from
127 + # detecting changes. Cache backends may raise this
128 + # exception from _setitem() if they detect this type of stat
129 + # collision. These exceptions are handled by bumping the
130 + # mtime on the ebuild (and the corresponding cache entry).
131 + # See bug #139134. It is convenient to include checks for
132 + # redundant writes along with the internal StatCollision
133 + # detection code, so for caches with the
134 + # raise_stat_collision attribute, we do not need to
135 + # explicitly check for redundant writes like we do for the
136 + # other cache types above.
137 + max_mtime = sc.mtime
138 + for _ec, ec_hash in metadata['_eclasses_'].items():
139 + if max_mtime < ec_hash.mtime:
140 + max_mtime = ec_hash.mtime
141 + if max_mtime == sc.mtime:
142 + max_mtime += 1
143 + max_mtime = long(max_mtime)
144 try:
145 + os.utime(ebuild_hash.location, (max_mtime, max_mtime))
146 + except OSError as e:
147 + self.returncode |= 1
148 + writemsg_level(
149 + "%s writing target: %s\n" % (cpv, e),
150 + level=logging.ERROR, noiselevel=-1)
151 + else:
152 + ebuild_hash.mtime = max_mtime
153 + metadata['_mtime_'] = max_mtime
154 trg_cache[cpv] = metadata
155 - except StatCollision as sc:
156 - # If the content of a cache entry changes and neither the
157 - # file mtime nor size changes, it will prevent rsync from
158 - # detecting changes. Cache backends may raise this
159 - # exception from _setitem() if they detect this type of stat
160 - # collision. These exceptions are handled by bumping the
161 - # mtime on the ebuild (and the corresponding cache entry).
162 - # See bug #139134. It is convenient to include checks for
163 - # redundant writes along with the internal StatCollision
164 - # detection code, so for caches with the
165 - # raise_stat_collision attribute, we do not need to
166 - # explicitly check for redundant writes like we do for the
167 - # other cache types above.
168 - max_mtime = sc.mtime
169 - for ec, ec_hash in metadata['_eclasses_'].items():
170 - if max_mtime < ec_hash.mtime:
171 - max_mtime = ec_hash.mtime
172 - if max_mtime == sc.mtime:
173 - max_mtime += 1
174 - max_mtime = long(max_mtime)
175 - try:
176 - os.utime(ebuild_hash.location, (max_mtime, max_mtime))
177 - except OSError as e:
178 - self.returncode |= 1
179 - writemsg_level(
180 - "%s writing target: %s\n" % (cpv, e),
181 - level=logging.ERROR, noiselevel=-1)
182 - else:
183 - ebuild_hash.mtime = max_mtime
184 - metadata['_mtime_'] = max_mtime
185 - trg_cache[cpv] = metadata
186 - self._portdb.auxdb[repo_path][cpv] = metadata
187 + self._portdb.auxdb[repo_path][cpv] = metadata
188
189 - except CacheError as ce:
190 - self.returncode |= 1
191 - writemsg_level(
192 - "%s writing target: %s\n" % (cpv, ce),
193 - level=logging.ERROR, noiselevel=-1)
194 + except CacheError as ce:
195 + self.returncode |= 1
196 + writemsg_level(
197 + "%s writing target: %s\n" % (cpv, ce),
198 + level=logging.ERROR, noiselevel=-1)
199
200 def run(self):
201 signum = run_main_scheduler(self._regen)
202 @@ -644,7 +645,8 @@ class _special_filename(_filename_base):
203 self.file_name = file_name
204 self.file_type = guessManifestFileType(file_name)
205
206 - def file_type_lt(self, a, b):
207 + @staticmethod
208 + def file_type_lt(a, b):
209 """
210 Defines an ordering between file types.
211 """
212
213 diff --git a/bin/emaint b/bin/emaint
214 index f0e4978..adf44d0 100755
215 --- a/bin/emaint
216 +++ b/bin/emaint
217 @@ -13,10 +13,10 @@ import errno
218 try:
219 import signal
220
221 - def exithandler(signum,frame):
222 + def exithandler(signum, _frame):
223 signal.signal(signal.SIGINT, signal.SIG_IGN)
224 signal.signal(signal.SIGTERM, signal.SIG_IGN)
225 - sys.exit(1)
226 + sys.exit(128 + signum)
227
228 signal.signal(signal.SIGINT, exithandler)
229 signal.signal(signal.SIGTERM, exithandler)
230
231 diff --git a/bin/emerge b/bin/emerge
232 index a7654bb..4d9ea5a 100755
233 --- a/bin/emerge
234 +++ b/bin/emerge
235 @@ -15,7 +15,7 @@ import sys
236 # Exception SystemExit: 130 in <function remove at 0x7fd2146c1320> ignored
237 try:
238
239 - def exithandler(signum,frame):
240 + def exithandler(signum, _frame):
241 signal.signal(signal.SIGTERM, signal.SIG_IGN)
242 sys.exit(128 + signum)
243
244 @@ -24,7 +24,7 @@ try:
245 # writing to a pipe.
246 signal.signal(signal.SIGPIPE, signal.SIG_DFL)
247
248 - def debug_signal(signum, frame):
249 + def debug_signal(_signum, _frame):
250 import pdb
251 pdb.set_trace()
252
253
254 diff --git a/bin/portageq b/bin/portageq
255 index f29c124..3dc5c28 100755
256 --- a/bin/portageq
257 +++ b/bin/portageq
258 @@ -9,7 +9,7 @@ import sys
259 # This block ensures that ^C interrupts are handled quietly.
260 try:
261
262 - def exithandler(signum, frame):
263 + def exithandler(signum, _frame):
264 signal.signal(signal.SIGINT, signal.SIG_IGN)
265 signal.signal(signal.SIGTERM, signal.SIG_IGN)
266 sys.exit(128 + signum)
267 @@ -178,8 +178,8 @@ def mass_best_version(argv):
268 return 2
269 try:
270 for pack in argv[1:]:
271 - mylist=portage.db[argv[0]]["vartree"].dbapi.match(pack)
272 - print(pack+":"+portage.best(mylist))
273 + mylist = portage.db[argv[0]]['vartree'].dbapi.match(pack)
274 + print('%s:%s' % (pack, portage.best(mylist)))
275 except KeyError:
276 return 1
277
278 @@ -187,15 +187,16 @@ def mass_best_version(argv):
279 @uses_eroot
280 def metadata(argv):
281 if (len(argv) < 4):
282 - print("ERROR: insufficient parameters!", file=sys.stderr)
283 + print('ERROR: insufficient parameters!', file=sys.stderr)
284 return 2
285
286 eroot, pkgtype, pkgspec = argv[0:3]
287 metakeys = argv[3:]
288 type_map = {
289 - "ebuild":"porttree",
290 - "binary":"bintree",
291 - "installed":"vartree"}
292 + 'ebuild': 'porttree',
293 + 'binary': 'bintree',
294 + 'installed': 'vartree'
295 + }
296 if pkgtype not in type_map:
297 print("Unrecognized package type: '%s'" % pkgtype, file=sys.stderr)
298 return 1
299 @@ -203,9 +204,9 @@ def metadata(argv):
300 repo = portage.dep.dep_getrepo(pkgspec)
301 pkgspec = portage.dep.remove_slot(pkgspec)
302 try:
303 - values = trees[eroot][type_map[pkgtype]].dbapi.aux_get(
304 - pkgspec, metakeys, myrepo=repo)
305 - writemsg_stdout(''.join('%s\n' % x for x in values), noiselevel=-1)
306 + values = trees[eroot][type_map[pkgtype]].dbapi.aux_get(
307 + pkgspec, metakeys, myrepo=repo)
308 + writemsg_stdout(''.join('%s\n' % x for x in values), noiselevel=-1)
309 except KeyError:
310 print("Package not found: '%s'" % pkgspec, file=sys.stderr)
311 return 1
312 @@ -396,7 +397,6 @@ def filter_protected(argv):
313 settings.get("CONFIG_PROTECT_MASK", ""))
314 protect_obj = ConfigProtect(root, protect, protect_mask)
315
316 - protected = 0
317 errors = 0
318
319 for line in sys.stdin:
320 @@ -418,7 +418,6 @@ def filter_protected(argv):
321 continue
322
323 if protect_obj.isprotected(f):
324 - protected += 1
325 out.write("%s\n" % filename)
326 out.flush()
327
328 @@ -466,8 +465,7 @@ def best_visible(argv):
329 noiselevel=-1)
330 return 2
331
332 - root_config = RootConfig(portage.settings,
333 - portage.db[eroot], None)
334 + root_config = RootConfig(portage.settings, portage.db[eroot], None)
335
336 if hasattr(db, "xmatch"):
337 cpv_list = db.xmatch("match-all-cpv-only", atom)
338 @@ -640,7 +638,7 @@ def expand_virtual(argv):
339 return os.EX_OK
340
341
342 -def vdb_path(argv):
343 +def vdb_path(_argv):
344 """
345 Returns the path used for the var(installed) package database for the
346 set environment/configuration options.
347 @@ -650,7 +648,7 @@ def vdb_path(argv):
348 out.flush()
349 return os.EX_OK
350
351 -def gentoo_mirrors(argv):
352 +def gentoo_mirrors(_argv):
353 """
354 Returns the mirrors set to use in the portage configuration.
355 """
356 @@ -676,49 +674,49 @@ def repos_config(argv):
357 """
358 return repositories_configuration(argv)
359
360 -def portdir(argv):
361 +def portdir(_argv):
362 """
363 Returns the PORTDIR path.
364 """
365 print(portage.settings["PORTDIR"])
366
367
368 -def config_protect(argv):
369 +def config_protect(_argv):
370 """
371 Returns the CONFIG_PROTECT paths.
372 """
373 print(portage.settings["CONFIG_PROTECT"])
374
375
376 -def config_protect_mask(argv):
377 +def config_protect_mask(_argv):
378 """
379 Returns the CONFIG_PROTECT_MASK paths.
380 """
381 print(portage.settings["CONFIG_PROTECT_MASK"])
382
383
384 -def portdir_overlay(argv):
385 +def portdir_overlay(_argv):
386 """
387 Returns the PORTDIR_OVERLAY path.
388 """
389 print(portage.settings["PORTDIR_OVERLAY"])
390
391
392 -def pkgdir(argv):
393 +def pkgdir(_argv):
394 """
395 Returns the PKGDIR path.
396 """
397 print(portage.settings["PKGDIR"])
398
399
400 -def distdir(argv):
401 +def distdir(_argv):
402 """
403 Returns the DISTDIR path.
404 """
405 print(portage.settings["DISTDIR"])
406
407
408 -def colormap(argv):
409 +def colormap(_argv):
410 """
411 Display the color.map as environment variables.
412 """
413 @@ -1319,10 +1317,10 @@ def main(argv):
414 sys.stderr.write("ERROR: This version of portageq"
415 " only supports <eroot>s ending in"
416 " '%s'. The provided <eroot>, '%s',"
417 - " doesn't.\n" % (eprefix, eroot));
418 + " doesn't.\n" % (eprefix, eroot))
419 sys.stderr.flush()
420 sys.exit(os.EX_USAGE)
421 - root = eroot[:1-len(eprefix)]
422 + root = eroot[:1 - len(eprefix)]
423 else:
424 root = eroot
425
426
427 diff --git a/bin/repoman b/bin/repoman
428 index 1a02050..63558fa 100755
429 --- a/bin/repoman
430 +++ b/bin/repoman
431 @@ -113,7 +113,7 @@ def err(txt):
432 warn(txt)
433 sys.exit(1)
434
435 -def exithandler(signum=None, frame=None):
436 +def exithandler(signum=None, _frame=None):
437 logging.fatal("Interrupted; exiting...")
438 if signum is None:
439 sys.exit(1)
440 @@ -1319,7 +1319,7 @@ if options.if_modified == "y":
441 chain(mychanged, mynew, myremoved)))
442
443 for x in effective_scanlist:
444 - #ebuilds and digests added to cvs respectively.
445 + # ebuilds and digests added to cvs respectively.
446 logging.info("checking package %s" % x)
447 # save memory by discarding xmatch caches from previous package(s)
448 arch_xmatch_caches.clear()
449 @@ -1413,9 +1413,9 @@ for x in effective_scanlist:
450 allvalid = True
451 for y in checkdirlist:
452 if (y in no_exec or y.endswith(".ebuild")) and \
453 - stat.S_IMODE(os.stat(os.path.join(checkdir, y)).st_mode) & 0o111:
454 - stats["file.executable"] += 1
455 - fails["file.executable"].append(os.path.join(checkdir, y))
456 + stat.S_IMODE(os.stat(os.path.join(checkdir, y)).st_mode) & 0o111:
457 + stats["file.executable"] += 1
458 + fails["file.executable"].append(os.path.join(checkdir, y))
459 if y.endswith(".ebuild"):
460 pf = y[:-7]
461 ebuildlist.append(pf)
462 @@ -1758,7 +1758,7 @@ for x in effective_scanlist:
463 fails["metadata.bad"].append("%s/metadata.xml: %s" % (x, e))
464 del e
465
466 - #Only carry out if in package directory or check forced
467 + # Only carry out if in package directory or check forced
468 if xmllint_capable and not metadata_bad:
469 # xmlint can produce garbage output even on success, so only dump
470 # the ouput when it fails.
471 @@ -1797,7 +1797,7 @@ for x in effective_scanlist:
472 fails['changelog.ebuildadded'].append(relative_path)
473
474 if vcs in ("cvs", "svn", "bzr") and check_ebuild_notadded and y not in eadded:
475 - #ebuild not added to vcs
476 + # ebuild not added to vcs
477 stats["ebuild.notadded"] += 1
478 fails["ebuild.notadded"].append(x + "/" + y + ".ebuild")
479 myesplit = portage.pkgsplit(y)
480 @@ -2122,7 +2122,7 @@ for x in effective_scanlist:
481 for mypos in range(len(myuse)):
482 stats["IUSE.invalid"] += 1
483 fails["IUSE.invalid"].append(x + "/" + y + ".ebuild: %s" % myuse[mypos])
484 -
485 +
486 # Check for outdated RUBY targets
487 if "ruby-ng" in inherited or "ruby-fakegem" in inherited or "ruby" in inherited:
488 ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
489 @@ -2149,7 +2149,7 @@ for x in effective_scanlist:
490 stats["LICENSE.deprecated"] += 1
491 fails["LICENSE.deprecated"].append("%s: %s" % (relative_path, lic))
492
493 - #keyword checks
494 + # keyword checks
495 myuse = myaux["KEYWORDS"].split()
496 for mykey in myuse:
497 if mykey not in ("-*", "*", "~*"):
498 @@ -2165,7 +2165,7 @@ for x in effective_scanlist:
499 stats["KEYWORDS.invalid"] += 1
500 fails["KEYWORDS.invalid"].append(x + "/" + y + ".ebuild: %s (profile invalid)" % mykey)
501
502 - #restrict checks
503 + # restrict checks
504 myrestrict = None
505 try:
506 myrestrict = portage.dep.use_reduce(myaux["RESTRICT"], matchall=1, flat=True)
507 @@ -2181,7 +2181,7 @@ for x in effective_scanlist:
508 stats["RESTRICT.invalid"] += len(mybadrestrict)
509 for mybad in mybadrestrict:
510 fails["RESTRICT.invalid"].append(x + "/" + y + ".ebuild: %s" % mybad)
511 - #REQUIRED_USE check
512 + # REQUIRED_USE check
513 required_use = myaux["REQUIRED_USE"]
514 if required_use:
515 if not eapi_has_required_use(eapi):
516 @@ -2247,133 +2247,133 @@ for x in effective_scanlist:
517
518 for keyword, groups, prof in relevant_profiles:
519
520 - if not (prof.status == "stable" or \
521 - (prof.status == "dev" and options.include_dev) or \
522 - (prof.status == "exp" and options.include_exp_profiles == 'y')):
523 - continue
524 + if not (prof.status == "stable" or \
525 + (prof.status == "dev" and options.include_dev) or \
526 + (prof.status == "exp" and options.include_exp_profiles == 'y')):
527 + continue
528
529 - dep_settings = arch_caches.get(prof.sub_path)
530 - if dep_settings is None:
531 - dep_settings = portage.config(
532 - config_profile_path=prof.abs_path,
533 - config_incrementals=repoman_incrementals,
534 - config_root=config_root,
535 - local_config=False,
536 - _unmatched_removal=options.unmatched_removal,
537 - env=env, repositories=repoman_settings.repositories)
538 - dep_settings.categories = repoman_settings.categories
539 - if options.without_mask:
540 - dep_settings._mask_manager_obj = \
541 - copy.deepcopy(dep_settings._mask_manager)
542 - dep_settings._mask_manager._pmaskdict.clear()
543 - arch_caches[prof.sub_path] = dep_settings
544 -
545 - xmatch_cache_key = (prof.sub_path, tuple(groups))
546 - xcache = arch_xmatch_caches.get(xmatch_cache_key)
547 - if xcache is None:
548 - portdb.melt()
549 - portdb.freeze()
550 - xcache = portdb.xcache
551 - xcache.update(shared_xmatch_caches)
552 - arch_xmatch_caches[xmatch_cache_key] = xcache
553 -
554 - trees[root]["porttree"].settings = dep_settings
555 - portdb.settings = dep_settings
556 - portdb.xcache = xcache
557 -
558 - dep_settings["ACCEPT_KEYWORDS"] = " ".join(groups)
559 - # just in case, prevent config.reset() from nuking these.
560 - dep_settings.backup_changes("ACCEPT_KEYWORDS")
561 -
562 - # This attribute is used in dbapi._match_use() to apply
563 - # use.stable.{mask,force} settings based on the stable
564 - # status of the parent package. This is required in order
565 - # for USE deps of unstable packages to be resolved correctly,
566 - # since otherwise use.stable.{mask,force} settings of
567 - # dependencies may conflict (see bug #456342).
568 - dep_settings._parent_stable = dep_settings._isStable(pkg)
569 -
570 - # Handle package.use*.{force,mask) calculation, for use
571 - # in dep_check.
572 - dep_settings.useforce = dep_settings._use_manager.getUseForce(
573 - pkg, stable=dep_settings._parent_stable)
574 - dep_settings.usemask = dep_settings._use_manager.getUseMask(
575 - pkg, stable=dep_settings._parent_stable)
576 -
577 - if not baddepsyntax:
578 - ismasked = not ebuild_archs or \
579 - pkg.cpv not in portdb.xmatch("match-visible", pkg.cp)
580 - if ismasked:
581 - if not have_pmasked:
582 - have_pmasked = bool(dep_settings._getMaskAtom(
583 - pkg.cpv, pkg._metadata))
584 - if options.ignore_masked:
585 - continue
586 - #we are testing deps for a masked package; give it some lee-way
587 - suffix = "masked"
588 - matchmode = "minimum-all"
589 - else:
590 - suffix = ""
591 - matchmode = "minimum-visible"
592 -
593 - if not have_dev_keywords:
594 - have_dev_keywords = \
595 - bool(dev_keywords.intersection(keywords))
596 -
597 - if prof.status == "dev":
598 - suffix = suffix + "indev"
599 -
600 - for mytype in Package._dep_keys:
601 -
602 - mykey = "dependency.bad" + suffix
603 - myvalue = myaux[mytype]
604 - if not myvalue:
605 - continue
606 -
607 - success, atoms = portage.dep_check(myvalue, portdb,
608 - dep_settings, use="all", mode=matchmode,
609 - trees=trees)
610 -
611 - if success:
612 - if atoms:
613 -
614 - # Don't bother with dependency.unknown for
615 - # cases in which *DEPEND.bad is triggered.
616 - for atom in atoms:
617 - # dep_check returns all blockers and they
618 - # aren't counted for *DEPEND.bad, so we
619 - # ignore them here.
620 - if not atom.blocker:
621 - unknown_pkgs.discard(
622 - (mytype, atom.unevaluated_atom))
623 -
624 - if not prof.sub_path:
625 - # old-style virtuals currently aren't
626 - # resolvable with empty profile, since
627 - # 'virtuals' mappings are unavailable
628 - # (it would be expensive to search
629 - # for PROVIDE in all ebuilds)
630 - atoms = [atom for atom in atoms if not \
631 - (atom.cp.startswith('virtual/') and \
632 - not portdb.cp_list(atom.cp))]
633 -
634 - #we have some unsolvable deps
635 - #remove ! deps, which always show up as unsatisfiable
636 - atoms = [str(atom.unevaluated_atom) \
637 - for atom in atoms if not atom.blocker]
638 -
639 - #if we emptied out our list, continue:
640 - if not atoms:
641 - continue
642 - stats[mykey] += 1
643 - fails[mykey].append("%s: %s: %s(%s) %s" % \
644 - (relative_path, mytype, keyword,
645 - prof, repr(atoms)))
646 - else:
647 + dep_settings = arch_caches.get(prof.sub_path)
648 + if dep_settings is None:
649 + dep_settings = portage.config(
650 + config_profile_path=prof.abs_path,
651 + config_incrementals=repoman_incrementals,
652 + config_root=config_root,
653 + local_config=False,
654 + _unmatched_removal=options.unmatched_removal,
655 + env=env, repositories=repoman_settings.repositories)
656 + dep_settings.categories = repoman_settings.categories
657 + if options.without_mask:
658 + dep_settings._mask_manager_obj = \
659 + copy.deepcopy(dep_settings._mask_manager)
660 + dep_settings._mask_manager._pmaskdict.clear()
661 + arch_caches[prof.sub_path] = dep_settings
662 +
663 + xmatch_cache_key = (prof.sub_path, tuple(groups))
664 + xcache = arch_xmatch_caches.get(xmatch_cache_key)
665 + if xcache is None:
666 + portdb.melt()
667 + portdb.freeze()
668 + xcache = portdb.xcache
669 + xcache.update(shared_xmatch_caches)
670 + arch_xmatch_caches[xmatch_cache_key] = xcache
671 +
672 + trees[root]["porttree"].settings = dep_settings
673 + portdb.settings = dep_settings
674 + portdb.xcache = xcache
675 +
676 + dep_settings["ACCEPT_KEYWORDS"] = " ".join(groups)
677 + # just in case, prevent config.reset() from nuking these.
678 + dep_settings.backup_changes("ACCEPT_KEYWORDS")
679 +
680 + # This attribute is used in dbapi._match_use() to apply
681 + # use.stable.{mask,force} settings based on the stable
682 + # status of the parent package. This is required in order
683 + # for USE deps of unstable packages to be resolved correctly,
684 + # since otherwise use.stable.{mask,force} settings of
685 + # dependencies may conflict (see bug #456342).
686 + dep_settings._parent_stable = dep_settings._isStable(pkg)
687 +
688 + # Handle package.use*.{force,mask) calculation, for use
689 + # in dep_check.
690 + dep_settings.useforce = dep_settings._use_manager.getUseForce(
691 + pkg, stable=dep_settings._parent_stable)
692 + dep_settings.usemask = dep_settings._use_manager.getUseMask(
693 + pkg, stable=dep_settings._parent_stable)
694 +
695 + if not baddepsyntax:
696 + ismasked = not ebuild_archs or \
697 + pkg.cpv not in portdb.xmatch("match-visible", pkg.cp)
698 + if ismasked:
699 + if not have_pmasked:
700 + have_pmasked = bool(dep_settings._getMaskAtom(
701 + pkg.cpv, pkg._metadata))
702 + if options.ignore_masked:
703 + continue
704 + # we are testing deps for a masked package; give it some lee-way
705 + suffix = "masked"
706 + matchmode = "minimum-all"
707 + else:
708 + suffix = ""
709 + matchmode = "minimum-visible"
710 +
711 + if not have_dev_keywords:
712 + have_dev_keywords = \
713 + bool(dev_keywords.intersection(keywords))
714 +
715 + if prof.status == "dev":
716 + suffix = suffix + "indev"
717 +
718 + for mytype in Package._dep_keys:
719 +
720 + mykey = "dependency.bad" + suffix
721 + myvalue = myaux[mytype]
722 + if not myvalue:
723 + continue
724 +
725 + success, atoms = portage.dep_check(myvalue, portdb,
726 + dep_settings, use="all", mode=matchmode,
727 + trees=trees)
728 +
729 + if success:
730 + if atoms:
731 +
732 + # Don't bother with dependency.unknown for
733 + # cases in which *DEPEND.bad is triggered.
734 + for atom in atoms:
735 + # dep_check returns all blockers and they
736 + # aren't counted for *DEPEND.bad, so we
737 + # ignore them here.
738 + if not atom.blocker:
739 + unknown_pkgs.discard(
740 + (mytype, atom.unevaluated_atom))
741 +
742 + if not prof.sub_path:
743 + # old-style virtuals currently aren't
744 + # resolvable with empty profile, since
745 + # 'virtuals' mappings are unavailable
746 + # (it would be expensive to search
747 + # for PROVIDE in all ebuilds)
748 + atoms = [atom for atom in atoms if not \
749 + (atom.cp.startswith('virtual/') and \
750 + not portdb.cp_list(atom.cp))]
751 +
752 + # we have some unsolvable deps
753 + # remove ! deps, which always show up as unsatisfiable
754 + atoms = [str(atom.unevaluated_atom) \
755 + for atom in atoms if not atom.blocker]
756 +
757 + # if we emptied out our list, continue:
758 + if not atoms:
759 + continue
760 stats[mykey] += 1
761 fails[mykey].append("%s: %s: %s(%s) %s" % \
762 (relative_path, mytype, keyword,
763 prof, repr(atoms)))
764 + else:
765 + stats[mykey] += 1
766 + fails[mykey].append("%s: %s: %s(%s) %s" % \
767 + (relative_path, mytype, keyword,
768 + prof, repr(atoms)))
769
770 if not baddepsyntax and unknown_pkgs:
771 type_map = {}