public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r9854 - main/trunk/pym/portage
@ 2008-04-12 19:37 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2008-04-12 19:37 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2008-04-12 19:37:26 +0000 (Sat, 12 Apr 2008)
New Revision: 9854

Modified:
   main/trunk/pym/portage/__init__.py
Log:
* Optimize config.setcpv() to return early if IUSE has not changed since
  the previous setcpv() call.

* Add EBUILD_PHASE to the blacklisted variables list.


Modified: main/trunk/pym/portage/__init__.py
===================================================================
--- main/trunk/pym/portage/__init__.py	2008-04-12 18:49:40 UTC (rev 9853)
+++ main/trunk/pym/portage/__init__.py	2008-04-12 19:37:26 UTC (rev 9854)
@@ -1291,7 +1291,8 @@
 			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)
@@ -1942,6 +1943,7 @@
 			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
@@ -1953,6 +1955,12 @@
 		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

-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-12 19:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-12 19:37 [gentoo-commits] portage r9854 - main/trunk/pym/portage Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox