1 |
Author: zmedico |
2 |
Date: 2010-02-09 03:41:02 +0000 (Tue, 09 Feb 2010) |
3 |
New Revision: 15330 |
4 |
|
5 |
Modified: |
6 |
main/trunk/bin/repoman |
7 |
Log: |
8 |
Use Atom.cp instead of dep_getkey(), and use cpv_getkey() instead of |
9 |
dep_getkey() where appropriate. |
10 |
|
11 |
|
12 |
Modified: main/trunk/bin/repoman |
13 |
=================================================================== |
14 |
--- main/trunk/bin/repoman 2010-02-09 03:21:34 UTC (rev 15329) |
15 |
+++ main/trunk/bin/repoman 2010-02-09 03:41:02 UTC (rev 15330) |
16 |
@@ -677,7 +677,7 @@ |
17 |
global_pmasklines = portage.util.stack_lists(global_pmasklines, incremental=1) |
18 |
global_pmaskdict = {} |
19 |
for x in global_pmasklines: |
20 |
- global_pmaskdict.setdefault(portage.dep_getkey(x), []).append(x) |
21 |
+ global_pmaskdict.setdefault(x.cp, []).append(x) |
22 |
del global_pmasklines |
23 |
|
24 |
def has_global_mask(pkg): |
25 |
@@ -1396,14 +1396,25 @@ |
26 |
"%s: '%s' found in thirdpartymirrors" % \ |
27 |
(relative_path, mirror)) |
28 |
|
29 |
+ provide = portage.flatten(portage.dep.use_reduce( |
30 |
+ portage.dep.paren_reduce(pkg.metadata['PROVIDE']), matchall=1)) |
31 |
+ provide_cps = [] |
32 |
+ |
33 |
# The Package class automatically evaluates USE conditionals. |
34 |
- for myprovide in portage.flatten(portage.dep.use_reduce( |
35 |
- portage.dep.paren_reduce(pkg.metadata['PROVIDE']), matchall=1)): |
36 |
- prov_cp = portage.dep_getkey(myprovide) |
37 |
+ for myprovide in provide: |
38 |
+ try: |
39 |
+ myprovide = portage.dep.Atom(myprovide) |
40 |
+ except portage.exception.InvalidAtom: |
41 |
+ stats["PROVIDE.syntax"] = stats["PROVIDE.syntax"] + 1 |
42 |
+ fails["PROVIDE.syntax"].append("%s: %s" % \ |
43 |
+ (relative_path, myprovide)) |
44 |
+ continue |
45 |
+ prov_cp = myprovide.cp |
46 |
+ provide_cps.append(prov_cp) |
47 |
if prov_cp != myprovide: |
48 |
stats["virtual.versioned"]+=1 |
49 |
fails["virtual.versioned"].append(x+"/"+y+".ebuild: "+myprovide) |
50 |
- prov_pkg = portage.dep_getkey( |
51 |
+ prov_pkg = portage.cpv_getkey( |
52 |
portage.best(portdb.xmatch("match-all", prov_cp))) |
53 |
if prov_cp == prov_pkg: |
54 |
stats["virtual.exists"]+=1 |
55 |
@@ -1584,12 +1595,12 @@ |
56 |
if mytype == "DEPEND" and \ |
57 |
not is_blocker and \ |
58 |
not inherited_java_eclass and \ |
59 |
- portage.dep_getkey(atom) == "virtual/jdk": |
60 |
+ atom.cp == "virtual/jdk": |
61 |
stats['java.eclassesnotused'] += 1 |
62 |
fails['java.eclassesnotused'].append(relative_path) |
63 |
elif mytype in ("PDEPEND", "RDEPEND"): |
64 |
if not is_blocker and \ |
65 |
- portage.dep_getkey(atom) in suspect_rdepend: |
66 |
+ atom.cp in suspect_rdepend: |
67 |
stats[mytype + '.suspect'] += 1 |
68 |
fails[mytype + '.suspect'].append( |
69 |
relative_path + ": '%s'" % atom) |
70 |
@@ -1777,8 +1788,7 @@ |
71 |
# just in case, prevent config.reset() from nuking these. |
72 |
dep_settings.backup_changes("ACCEPT_KEYWORDS") |
73 |
|
74 |
- for myprovide in myaux["PROVIDE"].split(): |
75 |
- prov_cp = portage.dep_getkey(myprovide) |
76 |
+ for prov_cp in provide_cps: |
77 |
if prov_cp not in dep_settings.getvirtuals(): |
78 |
stats["virtual.unavailable"]+=1 |
79 |
fails["virtual.unavailable"].append("%s: %s(%s) %s" % \ |