Fix breakage in REPLACING_VERSIONS support for emerge.
authorZac Medico <zmedico@gentoo.org>
Tue, 17 Aug 2010 18:24:15 +0000 (11:24 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 17 Aug 2010 18:24:15 +0000 (11:24 -0700)
pym/_emerge/EbuildExecuter.py
pym/_emerge/Scheduler.py

index 158099340aa762ed6b2ed80ec2416accf21354ca..513e6701955f5fceffe1db0ebb00df1b6b0e8dca 100644 (file)
@@ -6,7 +6,8 @@ from _emerge.TaskSequence import TaskSequence
 from _emerge.CompositeTask import CompositeTask
 import portage
 from portage import os
-from portage.eapi import eapi_has_src_prepare_and_src_configure
+from portage.eapi import eapi_has_src_prepare_and_src_configure, \
+       eapi_exports_replace_vars
 from portage.package.ebuild.doebuild import _prepare_env_file, \
        _prepare_fake_distdir
 
@@ -50,6 +51,13 @@ class EbuildExecuter(CompositeTask):
                settings.configdict["pkg"]["AA"] = " ".join(aalist)
                _prepare_fake_distdir(settings, alist)
 
+               if eapi_exports_replace_vars(settings['EAPI']):
+                       vardb = pkg.root_config.trees['vartree'].dbapi
+                       settings["REPLACING_VERSIONS"] = " ".join(
+                               set(portage.versions.cpv_getversion(match) \
+                                       for match in vardb.match(pkg.slot_atom) + \
+                                       vardb.match('='+pkg.cpv)))
+
                setup_phase = EbuildPhase(background=self.background,
                        phase="setup", scheduler=scheduler,
                        settings=settings)
index 6d7dbd9c350ca3b128cc3b7d1d8889efabff5593..43fa68a7787294c104198446b966f9829cf67e21 100644 (file)
@@ -915,6 +915,12 @@ class Scheduler(PollScheduler):
                                debug=(settings.get("PORTAGE_DEBUG", "") == 1),
                                mydbapi=self.trees[settings["ROOT"]][tree].dbapi, use_cache=1)
                        prepare_build_dirs(root_config.root, settings, cleanup=0)
+
+                       vardb = root_config.trees['vartree'].dbapi
+                       settings["REPLACING_VERSIONS"] = " ".join(
+                               set(portage.versions.cpv_getversion(match) \
+                                       for match in vardb.match(x.slot_atom) + \
+                                       vardb.match('='+x.cpv)))
                        pretend_phase = EbuildPhase(background=self._background,
                                phase="pretend", scheduler=self._sched_iface,
                                settings=settings)