commit:     0509af099b1eb69951936527b73bf0968653e16b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 10 19:53:49 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep 10 19:58:40 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0509af09

OwnerSet: fix exclude-files support (bug 694000)

Paths returned from iter_owners do not include a leading slash
since commit 5ace188b4499, therefore it's necessary to prepend
a leading slash for comparisons with exclude-files values.

Fixes: 5ace188b4499 ("FEATURES=case-insensitive-fs for bug #524236")
Bug: https://bugs.gentoo.org/694000
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/_sets/dbapi.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/portage/_sets/dbapi.py b/lib/portage/_sets/dbapi.py
index 299cb8157..5d78fd1d3 100644
--- a/lib/portage/_sets/dbapi.py
+++ b/lib/portage/_sets/dbapi.py
@@ -67,7 +67,8 @@ class OwnerSet(PackageSet):
 
        def mapPathsToAtoms(self, paths, exclude_paths=None):
                """
-               All paths must have $EROOT stripped from the left side.
+               All paths must begin with a slash, must include EPREFIX, and
+               must not include ROOT.
                """
                rValue = set()
                vardb = self._db
@@ -85,7 +86,9 @@ class OwnerSet(PackageSet):
                                pkg = pkg_str(link.mycpv, None)
                                atom = "%s:%s" % (pkg.cp, pkg.slot)
                                rValue.add(atom)
-                               if p in exclude_paths:
+                               # Returned paths are relative to ROOT and do 
not have
+                               # a leading slash.
+                               if '/' + p in exclude_paths:
                                        exclude_atoms.add(atom)
                        rValue.difference_update(exclude_atoms)
 

Reply via email to