When the metadata cache contains a negative EAPI, it means
authorZac Medico <zmedico@gentoo.org>
Thu, 4 Oct 2007 02:19:03 +0000 (02:19 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 4 Oct 2007 02:19:03 +0000 (02:19 -0000)
that the cache entry was generated by a version of portage
that did not support the eapi. When the user upgrades to a
version that now supports the previously unsupported EAPI,
those cache entries need to be regenerated. Therefore,
when a cache entry has a negative EAPI, check if the EAPI
would be supported and trigger a regen if appropriate.

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

pym/portage/dbapi/porttree.py

index dc54efe5c488614fadb7f9164a9c3677d6541969..71b2a2a2cf4c7ed98d6f4a6722ad899f849f4bdf 100644 (file)
@@ -282,7 +282,13 @@ class portdbapi(dbapi):
 
                try:
                        mydata = self.auxdb[mylocation][mycpv]
-                       if emtime != long(mydata.get("_mtime_", 0)):
+                       try:
+                               eapi = int(mydata.get("EAPI", 0))
+                       except ValueError:
+                               raise KeyError()
+                       if eapi < 0 and eapi_is_supported(-eapi):
+                               doregen = True
+                       elif emtime != long(mydata.get("_mtime_", 0)):
                                doregen = True
                        elif len(mydata.get("_eclasses_", [])) > 0:
                                doregen = not self.eclassdb.is_eclass_data_valid(mydata["_eclasses_"])