From be29874f34eeed526e4f6ed85e506133ae9ee9ec Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 23 Mar 2009 02:17:03 +0000 Subject: [PATCH] Make sure mysettings.setcpv() always gets called when necessary inside doebuild_environment(). (trunk r13136) svn path=/main/branches/2.1.6/; revision=13155 --- pym/portage/__init__.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 2c4b447b6..4462e0b12 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -5032,14 +5032,16 @@ def doebuild_environment(myebuild, mydo, myroot, mysettings, debug, use_cache, m # so that the caller can override it. tmpdir = mysettings["PORTAGE_TMPDIR"] - if mydo != "depend" and mycpv != mysettings.mycpv: - """For performance reasons, setcpv only triggers reset when it - detects a package-specific change in config. For the ebuild - environment, a reset call is forced in order to ensure that the - latest env.d variables are used.""" + if mycpv != mysettings.mycpv: + # Reload env.d variables and reset any previous settings. mysettings.reload() - mysettings.reset(use_cache=use_cache) - mysettings.setcpv(mycpv, use_cache=use_cache, mydb=mydbapi) + mysettings.reset() + if mydo == 'depend': + # Don't pass in mydbapi here since the resulting aux_get + # call would lead to infinite 'depend' phase recursion. + mysettings.setcpv(mycpv) + else: + mysettings.setcpv(mycpv, mydb=mydbapi) # config.reset() might have reverted a change made by the caller, # so restore it to it's original value. -- 2.26.2