Make portdbapi.getfetchlist() bail out if the EAPI
authorZac Medico <zmedico@gentoo.org>
Fri, 5 Oct 2007 03:17:02 +0000 (03:17 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 5 Oct 2007 03:17:02 +0000 (03:17 -0000)
is unsupported. This makes it impossible for an
unsupported EAPI to result in invalid Manifest
generation. (trunk r7916)

svn path=/main/branches/2.1.2/; revision=7938

pym/portage.py

index 693333b7b22bc772255b403ad278da7b3018d439..d17facf8f6498e3b9deb22230e3be4a5abf89fc7 100644 (file)
@@ -6343,13 +6343,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()