Binpkg: implement REPLACING_VERSIONS
authorZac Medico <zmedico@gentoo.org>
Fri, 31 Dec 2010 07:55:19 +0000 (23:55 -0800)
committerZac Medico <zmedico@gentoo.org>
Fri, 31 Dec 2010 07:56:27 +0000 (23:56 -0800)
pym/_emerge/Binpkg.py

index 8b93a2dfb49a6f8b52b8d6215132d0c4dda9dbe0..65a5ef4a51e4a7d878143a99bc61f8a51034031e 100644 (file)
@@ -9,6 +9,7 @@ from _emerge.CompositeTask import CompositeTask
 from _emerge.BinpkgVerifier import BinpkgVerifier
 from _emerge.EbuildMerge import EbuildMerge
 from _emerge.EbuildBuildDir import EbuildBuildDir
+from portage.eapi import eapi_exports_replace_vars
 from portage.util import writemsg
 import portage
 from portage import os
@@ -57,6 +58,13 @@ class Binpkg(CompositeTask):
                settings.configdict["pkg"]["EMERGE_FROM"] = "binary"
                settings.configdict["pkg"]["MERGE_TYPE"] = "binary"
 
+               if eapi_exports_replace_vars(settings["EAPI"]):
+                       vardb = self.pkg.root_config.trees["vartree"].dbapi
+                       settings["REPLACING_VERSIONS"] = " ".join(
+                               set(portage.versions.cpv_getversion(x) \
+                                       for x in vardb.match(self.pkg.slot_atom) + \
+                                       vardb.match('='+self.pkg.cpv)))
+
                # The prefetcher has already completed or it
                # could be running now. If it's running now,
                # wait for it to complete since it holds