summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-11-12 23:06:20 +0000
committerZac Medico <zmedico@gentoo.org>2009-11-12 23:06:20 +0000
commit366f0030e491917568a4df059e4af4c53a814301 (patch)
tree04a4de8b667110ad8928867a98ba2547eb45e82d
parentAdd setup phases to the tail of the merge queue instead of the front, since (diff)
downloadportage-multirepo-366f0030e491917568a4df059e4af4c53a814301.tar.gz
portage-multirepo-366f0030e491917568a4df059e4af4c53a814301.tar.bz2
portage-multirepo-366f0030e491917568a4df059e4af4c53a814301.zip
Implement dblink.__hash__ and __eq__, so that `portageq owners` correctly groups
search results. Also, increase iter_owners dblink cache size from 25 to 100 instances. svn path=/main/trunk/; revision=14817
-rw-r--r--pym/portage/dbapi/vartree.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 0be5632c..b1d66865 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -1624,7 +1624,7 @@ class vardbapi(dbapi):
def dblink(cpv):
x = dblink_cache.get(cpv)
if x is None:
- if len(dblink_fifo) >= 25:
+ if len(dblink_fifo) >= 100:
# Ensure that we don't run out of memory.
del dblink_cache[dblink_fifo.popleft().mycpv]
x = self._vardb._dblink(cpv)
@@ -1918,6 +1918,14 @@ class dblink(object):
self._contents_basenames = None
self._linkmap_broken = False
self._md5_merge_map = {}
+ self._hash_key = (self.myroot, self.mycpv)
+
+ def __hash__(self):
+ return hash(self._hash_key)
+
+ def __eq__(self, other):
+ return isinstance(other, dblink) and \
+ self._hash_key == other._hash_key
def lockdb(self):
if self._lock_vdb: