Non-integer EAPI isn't supported. In case it's supported in
authorZac Medico <zmedico@gentoo.org>
Thu, 4 Oct 2007 02:33:53 +0000 (02:33 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 4 Oct 2007 02:33:53 +0000 (02:33 -0000)
the future, assume that it's valid (rather than trigger a
regen).

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

pym/portage/dbapi/porttree.py

index 71b2a2a2cf4c7ed98d6f4a6722ad899f849f4bdf..83c568fa061969ca19d7aada6a77cb7c60ecd4e3 100644 (file)
@@ -282,11 +282,17 @@ class portdbapi(dbapi):
 
                try:
                        mydata = self.auxdb[mylocation][mycpv]
+                       eapi = mydata.get("EAPI","").strip()
+                       if not eapi:
+                               eapi = 0
                        try:
-                               eapi = int(mydata.get("EAPI", 0))
+                               eapi = int(eapi)
                        except ValueError:
-                               raise KeyError()
-                       if eapi < 0 and eapi_is_supported(-eapi):
+                               # Non-integer EAPI isn't supported. In case it's supported in
+                               # the future, assume that it's valid (rather than trigger a
+                               # regen).
+                               eapi = None
+                       if eapi is not None and eapi < 0 and eapi_is_supported(-eapi):
                                doregen = True
                        elif emtime != long(mydata.get("_mtime_", 0)):
                                doregen = True