Gentoo Archives: gentoo-portage-dev

From: SebastianLuther@×××.de
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] [PATCH 1/2] portdbapi.cp_list(): Don't write into xmatch's "match-all" cache
Date: Wed, 01 Jan 2014 22:14:32
Message-Id: 1388614451-18197-1-git-send-email-SebastianLuther@gmx.de
1 From: Sebastian Luther <SebastianLuther@×××.de>
2
3 xmatch returns _pkg_str instances these days. They require metadata
4 access, which cp_list doesn't have. That means that writing cp_list
5 results into the xmatch cache breaks xmatch users that expect _pkg_str
6 instances with full metadata.
7 ---
8 pym/portage/dbapi/porttree.py | 7 -------
9 1 file changed, 7 deletions(-)
10
11 diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
12 index fc3fc03..62ac75c 100644
13 --- a/pym/portage/dbapi/porttree.py
14 +++ b/pym/portage/dbapi/porttree.py
15 @@ -740,12 +740,6 @@ class portdbapi(dbapi):
16
17 if self.frozen and mytree is None:
18 cachelist = self.xcache["cp-list"].get(mycp)
19 - if cachelist is not None:
20 - # Try to propagate this to the match-all cache here for
21 - # repoman since he uses separate match-all caches for each
22 - # profile (due to differences in _get_implicit_iuse).
23 - self.xcache["match-all"][(mycp, mycp)] = cachelist
24 - return cachelist[:]
25 mysplit = mycp.split("/")
26 invalid_category = mysplit[0] not in self._categories
27 d={}
28 @@ -796,7 +790,6 @@ class portdbapi(dbapi):
29 if self.frozen and mytree is None:
30 cachelist = mylist[:]
31 self.xcache["cp-list"][mycp] = cachelist
32 - self.xcache["match-all"][(mycp, mycp)] = cachelist
33 return mylist
34
35 def freeze(self):
36 --
37 1.8.3.2

Replies