From 284039c4a9aa7d469c9f49adc2c92c2047559ce0 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 20 Sep 2009 18:38:00 +0000 Subject: In doebuild_environment(), detect if setcpv() hasn't been called properly, and call it if necessary (mainly for api consumers). svn path=/main/trunk/; revision=14298 --- pym/portage/__init__.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'pym') diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index a905d8e20..8837398cd 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -5881,12 +5881,18 @@ def doebuild_environment(myebuild, mydo, myroot, mysettings, debug, use_cache, m # so that the caller can override it. tmpdir = mysettings["PORTAGE_TMPDIR"] - if mycpv != mysettings.mycpv: - if mydo == 'depend': + if mydo == 'depend': + if mycpv != mysettings.mycpv: # Don't pass in mydbapi here since the resulting aux_get # call would lead to infinite 'depend' phase recursion. mysettings.setcpv(mycpv) - else: + else: + # If IUSE isn't in configdict['pkg'], it means that setcpv() + # hasn't been called with the mydb argument, so we have to + # call it here (portage code always calls setcpv properly, + # but api consumers might not). + if mycpv != mysettings.mycpv or \ + 'IUSE' not in mysettings.configdict['pkg']: # Reload env.d variables and reset any previous settings. mysettings.reload() mysettings.reset() -- cgit v1.2.3-1-g7c22