Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/_sets/
Date: Tue, 10 Sep 2019 20:03:34
Message-Id: 1568145520.0509af099b1eb69951936527b73bf0968653e16b.zmedico@gentoo
1 commit: 0509af099b1eb69951936527b73bf0968653e16b
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 10 19:53:49 2019 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 10 19:58:40 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=0509af09
7
8 OwnerSet: fix exclude-files support (bug 694000)
9
10 Paths returned from iter_owners do not include a leading slash
11 since commit 5ace188b4499, therefore it's necessary to prepend
12 a leading slash for comparisons with exclude-files values.
13
14 Fixes: 5ace188b4499 ("FEATURES=case-insensitive-fs for bug #524236")
15 Bug: https://bugs.gentoo.org/694000
16 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
17
18 lib/portage/_sets/dbapi.py | 7 +++++--
19 1 file changed, 5 insertions(+), 2 deletions(-)
20
21 diff --git a/lib/portage/_sets/dbapi.py b/lib/portage/_sets/dbapi.py
22 index 299cb8157..5d78fd1d3 100644
23 --- a/lib/portage/_sets/dbapi.py
24 +++ b/lib/portage/_sets/dbapi.py
25 @@ -67,7 +67,8 @@ class OwnerSet(PackageSet):
26
27 def mapPathsToAtoms(self, paths, exclude_paths=None):
28 """
29 - All paths must have $EROOT stripped from the left side.
30 + All paths must begin with a slash, must include EPREFIX, and
31 + must not include ROOT.
32 """
33 rValue = set()
34 vardb = self._db
35 @@ -85,7 +86,9 @@ class OwnerSet(PackageSet):
36 pkg = pkg_str(link.mycpv, None)
37 atom = "%s:%s" % (pkg.cp, pkg.slot)
38 rValue.add(atom)
39 - if p in exclude_paths:
40 + # Returned paths are relative to ROOT and do not have
41 + # a leading slash.
42 + if '/' + p in exclude_paths:
43 exclude_atoms.add(atom)
44 rValue.difference_update(exclude_atoms)