diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-08-17 10:55:21 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-08-17 10:55:21 -0700 |
commit | 25b07da67b75830f50edd28bf0c08cf60da5c10e (patch) | |
tree | 893b2f2be760cd0eb1c4c81471c8a4df1ca76e61 | |
parent | 7da58d6836eac167caa5d09f4bad1e194cf8728f (diff) | |
download | portage-25b07da67b75830f50edd28bf0c08cf60da5c10e.tar.gz portage-25b07da67b75830f50edd28bf0c08cf60da5c10e.tar.bz2 portage-25b07da67b75830f50edd28bf0c08cf60da5c10e.zip |
Fix the REPLACING_VERSIONS code to work in cases when the pretend/setup
phases are pulled in as dependencies of other phases.
-rw-r--r-- | pym/portage/package/ebuild/doebuild.py | 37 |
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", |