FakeVartree: preserve EAPI of installed package
authorZac Medico <zmedico@gentoo.org>
Wed, 25 May 2011 03:57:33 +0000 (20:57 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 25 May 2011 03:57:33 +0000 (20:57 -0700)
If the corresponding unbuilt ebuild has a different EAPI than the
installed instance, then we want to preserve the EAPI meatadata from
the installed instance.

pym/_emerge/FakeVartree.py

index 3e8113078e6e3d7849bb65274cc447d21254698f..51683ca5bf3ba7560fdc919d36c076aaa203e942 100644 (file)
@@ -92,7 +92,8 @@ class FakeVartree(vartree):
                        repo = _gen_valid_repo(repo)
                        live_metadata = dict(zip(self._portdb_keys,
                                self._portdb.aux_get(pkg, self._portdb_keys, myrepo=repo)))
-                       if not portage.eapi_is_supported(live_metadata["EAPI"]):
+                       if not portage.eapi_is_supported(live_metadata["EAPI"]) or \
+                               self._aux_get(pkg, ["EAPI"])[0] != live_metadata["EAPI"]:
                                raise KeyError(pkg)
                        self.dbapi.aux_update(pkg, live_metadata)
                except (KeyError, portage.exception.PortageException):