public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r10378 - main/branches/2.1.2/pym
@ 2008-05-20  3:08 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2008-05-20  3:08 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2008-05-20 03:08:36 +0000 (Tue, 20 May 2008)
New Revision: 10378

Modified:
   main/branches/2.1.2/pym/portage.py
Log:
* remove NEEDED from list of metadata variables (trunk r10180)
* Simplify cache code in vardbapi.aux_get(). (trunk r10377)


Modified: main/branches/2.1.2/pym/portage.py
===================================================================
--- main/branches/2.1.2/pym/portage.py	2008-05-20 03:06:32 UTC (rev 10377)
+++ main/branches/2.1.2/pym/portage.py	2008-05-20 03:08:36 UTC (rev 10378)
@@ -6573,7 +6573,7 @@
 		self._aux_cache_keys = set(
 			["CHOST", "COUNTER", "DEPEND", "DESCRIPTION",
 			"EAPI", "HOMEPAGE", "IUSE", "KEYWORDS",
-			"LICENSE", "PDEPEND", "PROVIDE", "RDEPEND", "NEEDED",
+			"LICENSE", "PDEPEND", "PROVIDE", "RDEPEND",
 			"repository", "RESTRICT" , "SLOT", "USE"])
 		self._aux_cache = None
 		self._aux_cache_version = "1"
@@ -6897,6 +6897,7 @@
 			raise KeyError(mycpv)
 		mydir_mtime = long(mydir_stat.st_mtime)
 		pkg_data = self._aux_cache["packages"].get(mycpv)
+		pull_me = cache_these.union(wants)
 		mydata = {}
 		cache_valid = False
 		cache_incomplete = False
@@ -6915,23 +6916,15 @@
 			cache_mtime, metadata = pkg_data
 			cache_valid = cache_mtime == mydir_mtime
 		if cache_valid:
-			cache_incomplete = cache_these.difference(metadata)
-			if cache_incomplete:
-				# Allow self._aux_cache_keys to change without a cache version
-				# bump and efficiently recycle partial cache whenever possible.
-				pull_me = cache_incomplete.union(wants)
-			else:
-				pull_me = set(wants).difference(cache_these)
 			mydata.update(metadata)
-		else:
-			pull_me = cache_these.union(wants)
+			pull_me.difference_update(metadata)
 
 		if pull_me:
 			# pull any needed data and cache it
 			aux_keys = list(pull_me)
 			for k, v in izip(aux_keys, self._aux_get(mycpv, aux_keys)):
 				mydata[k] = v
-			if not cache_valid or cache_incomplete:
+			if not cache_valid or cache_these.difference(metadata):
 				cache_data = {}
 				if cache_valid and metadata:
 					cache_data.update(metadata)

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



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

only message in thread, other threads:[~2008-05-20  3:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-20  3:08 [gentoo-commits] portage r10378 - main/branches/2.1.2/pym 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