Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/
Date: Sun, 15 Jul 2018 21:40:53
Message-Id: 1531690710.31edfe62541d8b55c64584b056ce64ad759f6a8e.zmedico@gentoo
1 commit: 31edfe62541d8b55c64584b056ce64ad759f6a8e
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jul 15 21:38:30 2018 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 15 21:38:30 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=31edfe62
7
8 portdbapi.xmatch: return separate items for each repo
9
10 Since xmatch match-all shares cache with the cp_list method, it needs
11 to return separate items when the same package version is found in
12 multiple repos.
13
14 Fixes: 27eeeb6e4fc8 ("portdbapi.cp_list: cache repo associations (bug 650814)")
15 Bug: https://bugs.gentoo.org/650814
16
17 pym/portage/dbapi/porttree.py | 19 +++----------------
18 1 file changed, 3 insertions(+), 16 deletions(-)
19
20 diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
21 index f6076ee2b..2e271ea76 100644
22 --- a/pym/portage/dbapi/porttree.py
23 +++ b/pym/portage/dbapi/porttree.py
24 @@ -1108,20 +1108,10 @@ class portdbapi(dbapi):
25 else:
26 iterfunc = iter
27
28 - if mydep.repo is not None:
29 - repos = [mydep.repo]
30 - else:
31 - # We iterate over self.porttrees, since it's common to
32 - # tweak this attribute in order to adjust match behavior.
33 - repos = []
34 - for tree in reversed(self.porttrees):
35 - repos.append(self.repositories.get_name_for_location(tree))
36 -
37 for cpv in iterfunc(mylist):
38 - for repo in repos:
39 try:
40 metadata = dict(zip(aux_keys,
41 - self.aux_get(cpv, aux_keys, myrepo=repo)))
42 + self.aux_get(cpv, aux_keys, myrepo=cpv.repo)))
43 except KeyError:
44 # ebuild not in this repo, or masked by corruption
45 continue
46 @@ -1145,11 +1135,8 @@ class portdbapi(dbapi):
47 continue
48
49 myval.append(pkg_str)
50 - # only yield a given cpv once
51 - break
52 -
53 - if myval and single_match:
54 - break
55 + if single_match:
56 + break
57
58 if single_match:
59 if myval: