summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-19 02:49:31 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-19 02:49:31 +0000
commitc26f6d206b2b07fa65e1916e5a6c6117ec992e97 (patch)
tree8a7e2ebff74951638446c57f887b845223cbdfeb
parente3add560fa350b457eda91964d1bdf8fe8e65ecd (diff)
downloadportage-c26f6d206b2b07fa65e1916e5a6c6117ec992e97.tar.gz
portage-c26f6d206b2b07fa65e1916e5a6c6117ec992e97.tar.bz2
portage-c26f6d206b2b07fa65e1916e5a6c6117ec992e97.zip
Trigger a config.regenerate() call inside setcpv() when the
EBUILD_PHASE variable is defined. It's too expensive to do the regenerate() call every time. Do in when EBUILD_PHASE is defined since it's needed to create the filtered USE that environ() passes to the ebuild environment. svn path=/main/trunk/; revision=8961
-rw-r--r--pym/portage/__init__.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index e277fe483..f861b266f 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -1906,7 +1906,7 @@ class config(object):
self.configdict["pkg"]["USE"] = self.puse[:] # this gets appended to USE
if iuse != self.configdict["pkg"].get("IUSE",""):
self.configdict["pkg"]["IUSE"] = iuse
- if self._use_wildcards:
+ if self._use_wildcards or self.get("EBUILD_PHASE"):
# Without this conditional, regenerate() would be called
# *every* time.
has_changed = True
@@ -3812,6 +3812,11 @@ def doebuild_environment(myebuild, mydo, myroot, mysettings, debug, use_cache, m
# so that the caller can override it.
tmpdir = mysettings["PORTAGE_TMPDIR"]
+ # This variable is a signal to setcpv where it triggers
+ # filtering of USE for the ebuild environment.
+ mysettings["EBUILD_PHASE"] = mydo
+ mysettings.backup_changes("EBUILD_PHASE")
+
if mydo != "depend":
"""For performance reasons, setcpv only triggers reset when it
detects a package-specific change in config. For the ebuild
@@ -3825,6 +3830,7 @@ def doebuild_environment(myebuild, mydo, myroot, mysettings, debug, use_cache, m
# so restore it to it's original value.
mysettings["PORTAGE_TMPDIR"] = tmpdir
+ mysettings.pop("EBUILD_PHASE", None) # remove from backupenv
mysettings["EBUILD_PHASE"] = mydo
mysettings["PORTAGE_MASTER_PID"] = str(os.getpid())