Merged from trunk -r15206:15209
authorFabian Groffen <grobian@gentoo.org>
Tue, 26 Jan 2010 17:53:51 +0000 (17:53 -0000)
committerFabian Groffen <grobian@gentoo.org>
Tue, 26 Jan 2010 17:53:51 +0000 (17:53 -0000)
   | 15207   | Bug #301926 - Handle ValueError in parseManifest2(),         |
   | zmedico | triggered by corrupt manifest entry.                         |

   | 15208   | Bug #302005 - Remove broken test code.                       |
   | zmedico |                                                              |

   | 15209   | Add a warning for built_with_use. Thanks to Petteri Räty    |
   | zmedico | <betelgeuse@g.o> for this patch.                             |

svn path=/main/branches/prefix/; revision=15210

pym/portage/manifest.py
pym/portage/sets/__init__.py
pym/repoman/checks.py
pym/repoman/errors.py

index 40a8d77b69687d941ae6dc9376e5084d63ecb9f5..fc8afb4cf5bcfda8bcd3334910f08f7b70c1c82b 100644 (file)
@@ -59,7 +59,10 @@ def parseManifest2(mysplit):
        if len(mysplit) > 4 and mysplit[0] in portage.const.MANIFEST2_IDENTIFIERS:
                mytype = mysplit[0]
                myname = mysplit[1]
-               mysize = int(mysplit[2])
+               try:
+                       mysize = int(mysplit[2])
+               except ValueError:
+                       return None
                myhashes = dict(zip(mysplit[3::2], mysplit[4::2]))
                myhashes["size"] = mysize
                myentry = Manifest2Entry(type=mytype, name=myname, hashes=myhashes)
index 59c3dbfd7498501af51971b90303d2e998404081..78f2628bd8ef8f09c91e62a89881b0d30d3c522a 100644 (file)
@@ -179,15 +179,3 @@ def load_default_config(settings, trees):
        setconfigpaths.append(os.path.join(settings["PORTAGE_CONFIGROOT"],
                USER_CONFIG_PATH, "sets.conf"))
        return SetConfig(setconfigpaths, settings, trees)
-
-# adhoc test code
-if __name__ == "__main__":
-       import portage
-       sc = load_default_config(portage.settings, portage.db["/"])
-       l, e = sc.getSets()
-       for x in l:
-               print(x+":")
-               print("DESCRIPTION = %s" % l[x].getMetadata("Description"))
-               for n in sorted(l[x].getAtoms()):
-                       print("- "+n)
-               print()
index 4e83e66539fe825e4601d24af7f951ce6362aa94..36e074c9f129884a6a62a7762166f46cceabce46 100644 (file)
@@ -432,6 +432,12 @@ class SrcUnpackPatches(PhaseCheck):
                                return ("'%s'" % m.group(1)) + \
                                        " call should be moved to src_prepare from line: %d"
 
+class BuiltWithUse(LineCheck):
+       repoman_check_name = 'ebuild.minorsyn'
+       ignore_line = re.compile(r'^\s*#')
+       re = re.compile('^.*built_with_use')
+       error = errors.BUILT_WITH_USE
+
 # EAPI-4 checks
 class Eapi4IncompatibleFuncs(LineCheck):
        repoman_check_name = 'EAPI.incompatible'
@@ -467,7 +473,6 @@ class Eapi4GoneVars(LineCheck):
                        return ("variable '$%s'" % m.group(1)) + \
                                " is gone in EAPI=4 on line: %d"
 
-
 _constant_checks = tuple((c() for c in (
        EbuildHeader, EbuildWhitespace, EbuildBlankLine, EbuildQuote,
        EbuildAssignment, EbuildUselessDodoc,
@@ -476,7 +481,7 @@ _constant_checks = tuple((c() for c in (
        IUseUndefined, InheritAutotools,
        EMakeParallelDisabled, EMakeParallelDisabledViaMAKEOPTS, NoAsNeeded,
        DeprecatedBindnowFlags, SrcUnpackPatches, WantAutoDefaultValue,
-       SrcCompileEconf, Eapi4IncompatibleFuncs, Eapi4GoneVars)))
+       SrcCompileEconf, Eapi4IncompatibleFuncs, Eapi4GoneVars, BuiltWithUse)))
 
 _here_doc_re = re.compile(r'.*\s<<[-]?(\w+)$')
 
index b62af12b366da6e02c44c905460f91599b4059de..cd1d7e3d74f142a8e65f0a6c7165c5931405e5e7 100644 (file)
@@ -18,3 +18,4 @@ EMAKE_PARALLEL_DISABLED_VIA_MAKEOPTS = 'Upstream parallel compilation bug (MAKEO
 DEPRECATED_BINDNOW_FLAGS = 'Deprecated bindnow-flags call on line: %d'
 EAPI_DEFINED_AFTER_INHERIT = 'EAPI defined after inherit on line: %d'
 NO_AS_NEEDED = 'Upstream asneeded linking bug (no-as-needed on line: %d)'
+BUILT_WITH_USE = 'built_with_use on line: %d'