From: Zac Medico Date: Tue, 9 Feb 2010 03:41:02 +0000 (-0000) Subject: Use Atom.cp instead of dep_getkey(), and use cpv_getkey() instead of X-Git-Tag: v2.2_rc63~68 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4734721c1b882ec4fdc004cd0d0490d31b3b31c1;p=portage.git Use Atom.cp instead of dep_getkey(), and use cpv_getkey() instead of dep_getkey() where appropriate. svn path=/main/trunk/; revision=15330 --- diff --git a/bin/repoman b/bin/repoman index 0253511ac..92f9cc1bf 100755 --- a/bin/repoman +++ b/bin/repoman @@ -677,7 +677,7 @@ repoman_settings.backup_changes('PORTAGE_ARCHLIST') global_pmasklines = portage.util.stack_lists(global_pmasklines, incremental=1) global_pmaskdict = {} for x in global_pmasklines: - global_pmaskdict.setdefault(portage.dep_getkey(x), []).append(x) + global_pmaskdict.setdefault(x.cp, []).append(x) del global_pmasklines def has_global_mask(pkg): @@ -1396,14 +1396,25 @@ for x in scanlist: "%s: '%s' found in thirdpartymirrors" % \ (relative_path, mirror)) + provide = portage.flatten(portage.dep.use_reduce( + portage.dep.paren_reduce(pkg.metadata['PROVIDE']), matchall=1)) + provide_cps = [] + # The Package class automatically evaluates USE conditionals. - for myprovide in portage.flatten(portage.dep.use_reduce( - portage.dep.paren_reduce(pkg.metadata['PROVIDE']), matchall=1)): - prov_cp = portage.dep_getkey(myprovide) + for myprovide in provide: + try: + myprovide = portage.dep.Atom(myprovide) + except portage.exception.InvalidAtom: + stats["PROVIDE.syntax"] = stats["PROVIDE.syntax"] + 1 + fails["PROVIDE.syntax"].append("%s: %s" % \ + (relative_path, myprovide)) + continue + prov_cp = myprovide.cp + provide_cps.append(prov_cp) if prov_cp != myprovide: stats["virtual.versioned"]+=1 fails["virtual.versioned"].append(x+"/"+y+".ebuild: "+myprovide) - prov_pkg = portage.dep_getkey( + prov_pkg = portage.cpv_getkey( portage.best(portdb.xmatch("match-all", prov_cp))) if prov_cp == prov_pkg: stats["virtual.exists"]+=1 @@ -1584,12 +1595,12 @@ for x in scanlist: if mytype == "DEPEND" and \ not is_blocker and \ not inherited_java_eclass and \ - portage.dep_getkey(atom) == "virtual/jdk": + atom.cp == "virtual/jdk": stats['java.eclassesnotused'] += 1 fails['java.eclassesnotused'].append(relative_path) elif mytype in ("PDEPEND", "RDEPEND"): if not is_blocker and \ - portage.dep_getkey(atom) in suspect_rdepend: + atom.cp in suspect_rdepend: stats[mytype + '.suspect'] += 1 fails[mytype + '.suspect'].append( relative_path + ": '%s'" % atom) @@ -1777,8 +1788,7 @@ for x in scanlist: # just in case, prevent config.reset() from nuking these. dep_settings.backup_changes("ACCEPT_KEYWORDS") - for myprovide in myaux["PROVIDE"].split(): - prov_cp = portage.dep_getkey(myprovide) + for prov_cp in provide_cps: if prov_cp not in dep_settings.getvirtuals(): stats["virtual.unavailable"]+=1 fails["virtual.unavailable"].append("%s: %s(%s) %s" % \