treewalk: set REPLACING_VERSIONS later
authorZac Medico <zmedico@gentoo.org>
Fri, 17 Jun 2011 20:57:02 +0000 (13:57 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 17 Jun 2011 20:57:02 +0000 (13:57 -0700)
Settings like this are better done after doebuild_environment, in case
doebuild_environment calls config.setcpv/reset. This avoids the need to
call backup_changes which is not really intended for per-package
settings since it tends to pollute the config instance with settings
that survive config.reset() calls.

pym/portage/dbapi/vartree.py

index 5c6166ca4eb0fc9f4eb00577070cf0349f8c6028..eacada6b323cbe00162a336c2f79428c0fe691a1 100644 (file)
@@ -3090,10 +3090,6 @@ class dblink(object):
                if retval:
                        return retval
 
-               self.settings["REPLACING_VERSIONS"] = " ".join( 
-                       [portage.versions.cpv_getversion(other.mycpv) for other in others_in_slot] )
-               self.settings.backup_changes("REPLACING_VERSIONS")
-
                if slot_matches:
                        # Used by self.isprotected().
                        max_dblnk = None
@@ -3243,6 +3239,9 @@ class dblink(object):
                        myebuild = os.path.join(inforoot, self.pkg + ".ebuild")
                doebuild_environment(myebuild, "preinst",
                        settings=self.settings, db=mydbapi)
+               self.settings["REPLACING_VERSIONS"] = " ".join(
+                       [portage.versions.cpv_getversion(other.mycpv)
+                       for other in others_in_slot])
                prepare_build_dirs(settings=self.settings, cleanup=cleanup)
 
                if collisions: