public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r10784 - in main/branches/prefix: bin pym/_emerge pym/portage/dbapi
@ 2008-06-25 18:49 Fabian Groffen (grobian)
  0 siblings, 0 replies; only message in thread
From: Fabian Groffen (grobian) @ 2008-06-25 18:49 UTC (permalink / raw
  To: gentoo-commits

Author: grobian
Date: 2008-06-25 18:49:44 +0000 (Wed, 25 Jun 2008)
New Revision: 10784

Modified:
   main/branches/prefix/bin/repoman
   main/branches/prefix/pym/_emerge/__init__.py
   main/branches/prefix/pym/portage/dbapi/vartree.py
Log:
   Merged from trunk 10781:10783

   | 10782   | After the depgraph caches the vardb state in a FakeVartree,  |
   | zmedico | to make some room on the heap, clear the vardbapi caches.    |
   
   | 10783   | Fix repoman breakage wrt _PackageMetadataWrapper._keys       |
   | zmedico | values.                                                      |


Modified: main/branches/prefix/bin/repoman
===================================================================
--- main/branches/prefix/bin/repoman	2008-06-25 12:41:22 UTC (rev 10783)
+++ main/branches/prefix/bin/repoman	2008-06-25 18:49:44 UTC (rev 10784)
@@ -355,7 +355,8 @@
 ]
 
 missingvars=["KEYWORDS","LICENSE","DESCRIPTION","HOMEPAGE","SLOT"]
-allvars = set(portage.auxdbkeys)
+allvars = set(x for x in portage.auxdbkeys if not x.startswith("UNUSED_"))
+allvars.discard("CDEPEND")
 allvars.update(Package.metadata_keys)
 allvars = sorted(allvars)
 commitmessage=None

Modified: main/branches/prefix/pym/_emerge/__init__.py
===================================================================
--- main/branches/prefix/pym/_emerge/__init__.py	2008-06-25 12:41:22 UTC (rev 10783)
+++ main/branches/prefix/pym/_emerge/__init__.py	2008-06-25 18:49:44 UTC (rev 10784)
@@ -1402,7 +1402,11 @@
 	"""
 	Detect metadata updates and synchronize Package attributes.
 	"""
-	_keys = Package.metadata_keys
+	_keys = set(x for x in portage.auxdbkeys \
+		if not x.startswith("UNUSED_"))
+	_keys.discard("CDEPEND")
+	_keys.update(Package.metadata_keys)
+	_keys = tuple(sorted(_keys))
 	__slots__ = ("__weakref__", "_pkg") + tuple("_val_" + k for k in _keys)
 	_wrapped_keys = frozenset(
 		["COUNTER", "INHERITED", "IUSE", "SLOT", "USE", "_mtime_"])
@@ -2052,6 +2056,14 @@
 					# This triggers metadata updates via FakeVartree.
 					vardb.aux_get(pkg.cpv, [])
 					fakedb.cpv_inject(pkg)
+
+			# Now that the vardb state is cached in our FakeVartree,
+			# we won't be needing the real vartree cache for awhile.
+			# To make some room on the heap, clear the vardbapi
+			# caches.
+			trees[myroot]["vartree"].dbapi._clear_cache()
+			gc.collect()
+
 			self.mydbapi[myroot] = fakedb
 			def graph_tree():
 				pass

Modified: main/branches/prefix/pym/portage/dbapi/vartree.py
===================================================================
--- main/branches/prefix/pym/portage/dbapi/vartree.py	2008-06-25 12:41:22 UTC (rev 10783)
+++ main/branches/prefix/pym/portage/dbapi/vartree.py	2008-06-25 18:49:44 UTC (rev 10784)
@@ -691,13 +691,19 @@
 	def checkblockers(self, origdep):
 		pass
 
+	def _clear_cache(self):
+		self.mtdircache.clear()
+		self.matchcache.clear()
+		self.cpcache.clear()
+		self._aux_cache_obj = None
+
 	def _add(self, pkg_dblink):
-		self._clear_cache(pkg_dblink)
+		self._clear_pkg_cache(pkg_dblink)
 
 	def _remove(self, pkg_dblink):
-		self._clear_cache(pkg_dblink)
+		self._clear_pkg_cache(pkg_dblink)
 
-	def _clear_cache(self, pkg_dblink):
+	def _clear_pkg_cache(self, pkg_dblink):
 		# Due to 1 second mtime granularity in <python-2.5, mtime checks
 		# are not always sufficient to invalidate vardbapi caches. Therefore,
 		# the caches need to be actively invalidated here.

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



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

only message in thread, other threads:[~2008-06-25 18:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-25 18:49 [gentoo-commits] portage r10784 - in main/branches/prefix: bin pym/_emerge pym/portage/dbapi Fabian Groffen (grobian)

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