summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/package/ebuild/doebuild.py37
1 files changed, 21 insertions, 16 deletions
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index b65425bee..a29d30f78 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -35,7 +35,8 @@ from portage.data import portage_gid, portage_uid, secpass, \
uid, userpriv_groups
from portage.dbapi.virtual import fakedbapi
from portage.dep import Atom, paren_enclose, use_reduce
-from portage.eapi import eapi_exports_KV, eapi_has_src_uri_arrows, \
+from portage.eapi import eapi_exports_KV, eapi_exports_replace_vars, \
+ eapi_has_src_uri_arrows, \
eapi_has_src_prepare_and_src_configure, eapi_has_pkg_pretend
from portage.elog import elog_process
from portage.elog.messages import eerror, eqawarn
@@ -489,21 +490,6 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
tmpdir_orig = None
try:
- if mydo in ("pretend", "setup"):
- if not vartree:
- writemsg("Warning: vartree not given to doebuild. " + \
- "Cannot set REPLACING_VERSIONS in pkg_{pretend,setup}\n")
- else:
- vardb = vartree.dbapi
- cpv = mysettings.mycpv
- cp = portage.versions.cpv_getkey(cpv)
- slot = mysettings.get("SLOT")
- cpv_slot = cp + ":" + slot
- mysettings["REPLACING_VERSIONS"] = " ".join(
- set(portage.versions.cpv_getversion(match) \
- for match in vardb.match(cpv_slot) + vardb.match(cpv)))
- mysettings.backup_changes("REPLACING_VERSIONS")
-
if mydo in ("digest", "manifest", "help"):
# Temporarily exempt the depend phase from manifest checks, in case
# aux_get calls trigger cache generation.
@@ -613,6 +599,25 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
if rval != os.EX_OK:
return rval
+ if eapi_exports_replace_vars(mysettings["EAPI"]) and \
+ (mydo in ("pretend", "setup") or \
+ ("noauto" not in features and not returnpid and \
+ (mydo in actionmap_deps or mydo in ("merge", "package", "qmerge")))):
+ if not vartree:
+ writemsg("Warning: vartree not given to doebuild. " + \
+ "Cannot set REPLACING_VERSIONS in pkg_{pretend,setup}\n")
+ else:
+ vardb = vartree.dbapi
+ cpv = mysettings.mycpv
+ cp = portage.versions.cpv_getkey(cpv)
+ slot = mysettings["SLOT"]
+ cpv_slot = cp + ":" + slot
+ mysettings["REPLACING_VERSIONS"] = " ".join(
+ 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.
if mydo in ("config", "help", "info", "postinst",