Make portdbapi.getfetchlist() bail out if the EAPI
authorZac Medico <zmedico@gentoo.org>
Thu, 4 Oct 2007 07:05:11 +0000 (07:05 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 4 Oct 2007 07:05:11 +0000 (07:05 -0000)
is unsupported. This makes it impossible for an
unsupported EAPI to result in invalid Manifest
generation.

svn path=/main/trunk/; revision=7916

pym/portage/dbapi/porttree.py

index 83c568fa061969ca19d7aada6a77cb7c60ecd4e3..2c205ae9ed31170bfe911a8dd644d3762fd268be 100644 (file)
@@ -371,13 +371,20 @@ class portdbapi(dbapi):
                if mysettings is None:
                        mysettings = self.mysettings
                try:
-                       myuris = self.aux_get(mypkg, ["SRC_URI"], mytree=mytree)[0]
+                       eapi, myuris = self.aux_get(mypkg,
+                               ["EAPI", "SRC_URI"], mytree=mytree)
                except KeyError:
                        # Convert this to an InvalidDependString exception since callers
                        # already handle it.
                        raise portage.exception.InvalidDependString(
                                "getfetchlist(): aux_get() error reading "+mypkg+"; aborting.")
 
+               if not eapi_is_supported(eapi):
+                       # Convert this to an InvalidDependString exception
+                       # since callers already handle it.
+                       raise portage.exception.InvalidDependString(
+                               "getfetchlist(): Unsupported EAPI: '%s'" % eapi.lstrip("-"))
+
                if useflags is None:
                        useflags = mysettings["USE"].split()