Account for empty EAPI
authorJason Stubbs <jstubbs@gentoo.org>
Wed, 5 Oct 2005 16:58:09 +0000 (16:58 -0000)
committerJason Stubbs <jstubbs@gentoo.org>
Wed, 5 Oct 2005 16:58:09 +0000 (16:58 -0000)
svn path=/main/branches/2.0/; revision=2102

pym/portage.py

index 00ef400076e5072980635243a97e895e622c8c6a..d8a1026c0616b4f64144203b9e007d165d0fd4cd 100644 (file)
@@ -5344,7 +5344,8 @@ class portdbapi(dbapi):
                if doregen and mylocation==self.mysettings["PORTDIR"] and metacachedir and self.metadb[cat].has_key(pkg):
                        metadata=self.metadb[cat][pkg]
 
-                       metadata["EAPI"] = metadata.get("EAPI", "0").strip()
+                       if "EAPI" not in metadata or not metadata["EAPI"].strip():
+                               metadata["EAPI"] = "0"
 
                        if not eapi_is_supported(metadata["EAPI"]):
                                # intentionally wipe keys.
@@ -5426,7 +5427,8 @@ class portdbapi(dbapi):
                                        mylines[x] = mylines[x][:-1]
                                mydata[auxdbkeys[x]] = mylines[x]
 
-                       mydata["EAPI"] = mydata.get("EAPI", "0").strip()
+                       if "EAPI" not in mydata or not mydata["EAPI"].strip():
+                               mydata["EAPI"] = "0"
 
                        if not eapi_is_supported(mydata["EAPI"]):
                                # if newer version, wipe everything and negate eapi