1 |
Author: zmedico |
2 |
Date: 2008-03-28 13:02:47 +0000 (Fri, 28 Mar 2008) |
3 |
New Revision: 9575 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.2/bin/repoman |
7 |
main/branches/2.1.2/man/repoman.1 |
8 |
Log: |
9 |
Bug #209418 - Add a new KEYWORDS.dropped check that compares keywords |
10 |
against the keywords of earlier ebuild versions within a slot. (trunk r9522) |
11 |
|
12 |
|
13 |
Modified: main/branches/2.1.2/bin/repoman |
14 |
=================================================================== |
15 |
--- main/branches/2.1.2/bin/repoman 2008-03-28 12:59:23 UTC (rev 9574) |
16 |
+++ main/branches/2.1.2/bin/repoman 2008-03-28 13:02:47 UTC (rev 9575) |
17 |
@@ -166,6 +166,7 @@ |
18 |
"file.size":"Files in the files directory must be under 20k", |
19 |
"file.name":"File/dir name must be composed of only the following chars: %s " % allowed_filename_chars, |
20 |
"file.UTF8":"File is not UTF8 compliant", |
21 |
+ "KEYWORDS.dropped":"Ebuilds that appear to have dropped KEYWORDS for some arch", |
22 |
"KEYWORDS.missing":"Ebuilds that have a missing or empty KEYWORDS variable", |
23 |
"KEYWORDS.stable":"Ebuilds that have been added directly with stable KEYWORDS", |
24 |
"KEYWORDS.stupid":"Ebuilds that use KEYWORDS=-* instead of package.mask", |
25 |
@@ -234,6 +235,7 @@ |
26 |
"DEPEND.badindev","RDEPEND.badindev","PDEPEND.badindev", |
27 |
"DEPEND.badmaskedindev","RDEPEND.badmaskedindev","PDEPEND.badmaskedindev", |
28 |
"DESCRIPTION.toolong", |
29 |
+"KEYWORDS.dropped", |
30 |
"KEYWORDS.stupid", |
31 |
"KEYWORDS.missing", |
32 |
"RESTRICT.invalid", |
33 |
@@ -1157,8 +1159,20 @@ |
34 |
fails["EAPI.unsupported"].append(os.path.join(x, y)) |
35 |
continue |
36 |
ebuild_metadata[pf] = myaux |
37 |
- ebuildlist.sort() |
38 |
|
39 |
+ # Sort ebuilds in ascending order for the KEYWORDS.dropped check. |
40 |
+ pkgsplits = {} |
41 |
+ for i in xrange(len(ebuildlist)): |
42 |
+ ebuild_split = tuple(portage.pkgsplit(ebuildlist[i])) |
43 |
+ pkgsplits[ebuild_split] = ebuildlist[i] |
44 |
+ ebuildlist[i] = ebuild_split |
45 |
+ ebuildlist.sort(portage.pkgcmp) |
46 |
+ for i in xrange(len(ebuildlist)): |
47 |
+ ebuildlist[i] = pkgsplits[ebuildlist[i]] |
48 |
+ del pkgsplits |
49 |
+ |
50 |
+ slot_keywords = {} |
51 |
+ |
52 |
if len(ebuild_metadata) != len(ebuildlist): |
53 |
# If we can't access all the metadata then it's totally unsafe to |
54 |
# commit since there's no way to generate a correct Manifest. |
55 |
@@ -1508,6 +1522,22 @@ |
56 |
x + "/" + y + ".ebuild added with stable keywords: %s" % \ |
57 |
" ".join(stable_keywords)) |
58 |
|
59 |
+ ebuild_archs = set(kw.lstrip("~") for kw in keywords \ |
60 |
+ if not kw.startswith("-")) |
61 |
+ |
62 |
+ previous_keywords = slot_keywords.get(myaux["SLOT"]) |
63 |
+ if previous_keywords is None: |
64 |
+ slot_keywords[myaux["SLOT"]] = set() |
65 |
+ else: |
66 |
+ dropped_keywords = previous_keywords.difference(ebuild_archs) |
67 |
+ if dropped_keywords: |
68 |
+ stats["KEYWORDS.dropped"] += 1 |
69 |
+ fails["KEYWORDS.dropped"].append( |
70 |
+ relative_path + ": %s" % \ |
71 |
+ " ".join(sorted(dropped_keywords))) |
72 |
+ |
73 |
+ slot_keywords[myaux["SLOT"]].update(ebuild_archs) |
74 |
+ |
75 |
# KEYWORDS="-*" is a stupid replacement for package.mask and screws general KEYWORDS semantics |
76 |
if "-*" in keywords: |
77 |
haskeyword = False |
78 |
|
79 |
Modified: main/branches/2.1.2/man/repoman.1 |
80 |
=================================================================== |
81 |
--- main/branches/2.1.2/man/repoman.1 2008-03-28 12:59:23 UTC (rev 9574) |
82 |
+++ main/branches/2.1.2/man/repoman.1 2008-03-28 13:02:47 UTC (rev 9575) |
83 |
@@ -111,6 +111,9 @@ |
84 |
.B IUSE.invalid |
85 |
This build has a variable in IUSE that is not in the use.desc or use.local.desc file |
86 |
.TP |
87 |
+.B KEYWORDS.dropped |
88 |
+Ebuilds that appear to have dropped KEYWORDS for some arch |
89 |
+.TP |
90 |
.B KEYWORDS.invalid |
91 |
This ebuild contains KEYWORDS that are not listed in profiles/arch.list or for which no valid profile was found |
92 |
.TP |
93 |
|
94 |
-- |
95 |
gentoo-commits@l.g.o mailing list |