doebuild: don't set REPLACING_VERSIONS for remove
authorZac Medico <zmedico@gentoo.org>
Fri, 17 Jun 2011 19:39:06 +0000 (12:39 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 17 Jun 2011 19:39:06 +0000 (12:39 -0700)
Also, don't call backup_changes with this variable, since it's not
necessary and we don't want to pollute the config instance.

pym/portage/package/ebuild/doebuild.py

index 782e8f1b5fcb02e9b0245e2353ad56cb089dc00f..9df7dc76c3358047e045a779b8639e9b5c1293d7 100644 (file)
@@ -701,8 +701,13 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                                mysettings.configdict["pkg"]["EMERGE_FROM"] = "binary"
                                mysettings.configdict["pkg"]["MERGE_TYPE"] = "binary"
 
+               # NOTE: It's not possible to set REPLACED_BY_VERSION for prerm
+               #       and postrm here, since we don't necessarily know what
+               #       versions are being installed. This could be a problem
+               #       for API consumers if they don't use dblink.treewalk()
+               #       to execute prerm and postrm.
                if eapi_exports_replace_vars(mysettings["EAPI"]) and \
-                       (mydo in ("postinst", "postrm", "preinst", "prerm", "pretend", "setup") or \
+                       (mydo in ("postinst", "preinst", "pretend", "setup") or \
                        ("noauto" not in features and not returnpid and \
                        (mydo in actionmap_deps or mydo in ("merge", "package", "qmerge")))):
                        if not vartree:
@@ -718,7 +723,6 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                                        set(portage.versions.cpv_getversion(match) \
                                                for match in vardb.match(cpv_slot) + \
                                                vardb.match('='+cpv)))
-                               mysettings.backup_changes("REPLACING_VERSIONS")
 
                # if any of these are being called, handle them -- running them out of
                # the sandbox -- and stop now.