diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-09-20 18:38:00 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-09-20 18:38:00 +0000 |
commit | 284039c4a9aa7d469c9f49adc2c92c2047559ce0 (patch) | |
tree | 172aa3de5841b5ee3bcdbe05b5fd702b897ce6da | |
parent | aa2c1713881e41804595cf9559a4d6b45939b723 (diff) | |
download | portage-284039c4a9aa7d469c9f49adc2c92c2047559ce0.tar.gz portage-284039c4a9aa7d469c9f49adc2c92c2047559ce0.tar.bz2 portage-284039c4a9aa7d469c9f49adc2c92c2047559ce0.zip |
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
-rw-r--r-- | pym/portage/__init__.py | 12 |
1 files changed, 9 insertions, 3 deletions
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() |