1 |
Author: grobian |
2 |
Date: 2010-01-26 17:53:51 +0000 (Tue, 26 Jan 2010) |
3 |
New Revision: 15210 |
4 |
|
5 |
Modified: |
6 |
main/branches/prefix/pym/portage/manifest.py |
7 |
main/branches/prefix/pym/portage/sets/__init__.py |
8 |
main/branches/prefix/pym/repoman/checks.py |
9 |
main/branches/prefix/pym/repoman/errors.py |
10 |
Log: |
11 |
Merged from trunk -r15206:15209 |
12 |
|
13 |
| 15207 | Bug #301926 - Handle ValueError in parseManifest2(), | |
14 |
| zmedico | triggered by corrupt manifest entry. | |
15 |
|
16 |
| 15208 | Bug #302005 - Remove broken test code. | |
17 |
| zmedico | | |
18 |
|
19 |
| 15209 | Add a warning for built_with_use. Thanks to Petteri R?\195?\164ty | |
20 |
| zmedico | <betelgeuse@g.o> for this patch. | |
21 |
|
22 |
|
23 |
Modified: main/branches/prefix/pym/portage/manifest.py |
24 |
=================================================================== |
25 |
--- main/branches/prefix/pym/portage/manifest.py 2010-01-24 17:10:52 UTC (rev 15209) |
26 |
+++ main/branches/prefix/pym/portage/manifest.py 2010-01-26 17:53:51 UTC (rev 15210) |
27 |
@@ -59,7 +59,10 @@ |
28 |
if len(mysplit) > 4 and mysplit[0] in portage.const.MANIFEST2_IDENTIFIERS: |
29 |
mytype = mysplit[0] |
30 |
myname = mysplit[1] |
31 |
- mysize = int(mysplit[2]) |
32 |
+ try: |
33 |
+ mysize = int(mysplit[2]) |
34 |
+ except ValueError: |
35 |
+ return None |
36 |
myhashes = dict(zip(mysplit[3::2], mysplit[4::2])) |
37 |
myhashes["size"] = mysize |
38 |
myentry = Manifest2Entry(type=mytype, name=myname, hashes=myhashes) |
39 |
|
40 |
Modified: main/branches/prefix/pym/portage/sets/__init__.py |
41 |
=================================================================== |
42 |
--- main/branches/prefix/pym/portage/sets/__init__.py 2010-01-24 17:10:52 UTC (rev 15209) |
43 |
+++ main/branches/prefix/pym/portage/sets/__init__.py 2010-01-26 17:53:51 UTC (rev 15210) |
44 |
@@ -179,15 +179,3 @@ |
45 |
setconfigpaths.append(os.path.join(settings["PORTAGE_CONFIGROOT"], |
46 |
USER_CONFIG_PATH, "sets.conf")) |
47 |
return SetConfig(setconfigpaths, settings, trees) |
48 |
- |
49 |
-# adhoc test code |
50 |
-if __name__ == "__main__": |
51 |
- import portage |
52 |
- sc = load_default_config(portage.settings, portage.db["/"]) |
53 |
- l, e = sc.getSets() |
54 |
- for x in l: |
55 |
- print(x+":") |
56 |
- print("DESCRIPTION = %s" % l[x].getMetadata("Description")) |
57 |
- for n in sorted(l[x].getAtoms()): |
58 |
- print("- "+n) |
59 |
- print() |
60 |
|
61 |
Modified: main/branches/prefix/pym/repoman/checks.py |
62 |
=================================================================== |
63 |
--- main/branches/prefix/pym/repoman/checks.py 2010-01-24 17:10:52 UTC (rev 15209) |
64 |
+++ main/branches/prefix/pym/repoman/checks.py 2010-01-26 17:53:51 UTC (rev 15210) |
65 |
@@ -432,6 +432,12 @@ |
66 |
return ("'%s'" % m.group(1)) + \ |
67 |
" call should be moved to src_prepare from line: %d" |
68 |
|
69 |
+class BuiltWithUse(LineCheck): |
70 |
+ repoman_check_name = 'ebuild.minorsyn' |
71 |
+ ignore_line = re.compile(r'^\s*#') |
72 |
+ re = re.compile('^.*built_with_use') |
73 |
+ error = errors.BUILT_WITH_USE |
74 |
+ |
75 |
# EAPI-4 checks |
76 |
class Eapi4IncompatibleFuncs(LineCheck): |
77 |
repoman_check_name = 'EAPI.incompatible' |
78 |
@@ -467,7 +473,6 @@ |
79 |
return ("variable '$%s'" % m.group(1)) + \ |
80 |
" is gone in EAPI=4 on line: %d" |
81 |
|
82 |
- |
83 |
_constant_checks = tuple((c() for c in ( |
84 |
EbuildHeader, EbuildWhitespace, EbuildBlankLine, EbuildQuote, |
85 |
EbuildAssignment, EbuildUselessDodoc, |
86 |
@@ -476,7 +481,7 @@ |
87 |
IUseUndefined, InheritAutotools, |
88 |
EMakeParallelDisabled, EMakeParallelDisabledViaMAKEOPTS, NoAsNeeded, |
89 |
DeprecatedBindnowFlags, SrcUnpackPatches, WantAutoDefaultValue, |
90 |
- SrcCompileEconf, Eapi4IncompatibleFuncs, Eapi4GoneVars))) |
91 |
+ SrcCompileEconf, Eapi4IncompatibleFuncs, Eapi4GoneVars, BuiltWithUse))) |
92 |
|
93 |
_here_doc_re = re.compile(r'.*\s<<[-]?(\w+)$') |
94 |
|
95 |
|
96 |
Modified: main/branches/prefix/pym/repoman/errors.py |
97 |
=================================================================== |
98 |
--- main/branches/prefix/pym/repoman/errors.py 2010-01-24 17:10:52 UTC (rev 15209) |
99 |
+++ main/branches/prefix/pym/repoman/errors.py 2010-01-26 17:53:51 UTC (rev 15210) |
100 |
@@ -18,3 +18,4 @@ |
101 |
DEPRECATED_BINDNOW_FLAGS = 'Deprecated bindnow-flags call on line: %d' |
102 |
EAPI_DEFINED_AFTER_INHERIT = 'EAPI defined after inherit on line: %d' |
103 |
NO_AS_NEEDED = 'Upstream asneeded linking bug (no-as-needed on line: %d)' |
104 |
+BUILT_WITH_USE = 'built_with_use on line: %d' |