summaryrefslogtreecommitdiffstats
path: root/pym/portage.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-04-12 19:40:28 +0000
committerZac Medico <zmedico@gentoo.org>2008-04-12 19:40:28 +0000
commit634bced1a092da0b77ccf8d86f24def4def11327 (patch)
tree5e3dab395834ad0158ce421471d5f953693cfb5a /pym/portage.py
parent3c41ba2bddcbab616e76b1661d63eaa83fdc1c21 (diff)
downloadportage-634bced1a092da0b77ccf8d86f24def4def11327.tar.gz
portage-634bced1a092da0b77ccf8d86f24def4def11327.tar.bz2
portage-634bced1a092da0b77ccf8d86f24def4def11327.zip
* Optimize config.setcpv() to return early if IUSE has not changed since
the previous setcpv() call. * Add EBUILD_PHASE to the blacklisted variables list. (trunk r9854) svn path=/main/branches/2.1.2/; revision=9855
Diffstat (limited to 'pym/portage.py')
-rw-r--r--pym/portage.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/pym/portage.py b/pym/portage.py
index b7c1db52b..b4c200bf5 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1451,7 +1451,8 @@ class config:
self.lookuplist.reverse()
# Blacklist vars that could interfere with portage internals.
- for blacklisted in "CATEGORY", "PKGUSE", "PORTAGE_CONFIGROOT", \
+ for blacklisted in "CATEGORY", "EBUILD_PHASE", \
+ "PKGUSE", "PORTAGE_CONFIGROOT", \
"PORTAGE_IUSE", "PORTAGE_USE", "ROOT":
for cfg in self.lookuplist:
cfg.pop(blacklisted, None)
@@ -2003,6 +2004,7 @@ class config:
has_changed = True
self.configdict["pkg"]["PKGUSE"] = self.puse[:] # For saving to PUSE file
self.configdict["pkg"]["USE"] = self.puse[:] # this gets appended to USE
+ previous_iuse = self.configdict["pkg"].get("IUSE")
self.configdict["pkg"]["IUSE"] = iuse
# Always set known good values for these variables, since
@@ -2014,6 +2016,12 @@ class config:
if has_changed:
self.reset(keeping_pkg=1,use_cache=use_cache)
+ # If this is not an ebuild phase and reset() has not been called,
+ # it's safe to return early here if IUSE has not changed.
+ if not (has_changed or ebuild_phase) and \
+ previous_iuse == iuse:
+ return
+
# Filter out USE flags that aren't part of IUSE. This has to
# be done for every setcpv() call since practically every
# package has different IUSE. Some flags are considered to