diff --git a/src/python/jw/pkg/lib/pf/Pkg.py b/src/python/jw/pkg/lib/pf/Pkg.py index be26db2e..9eddecdb 100644 --- a/src/python/jw/pkg/lib/pf/Pkg.py +++ b/src/python/jw/pkg/lib/pf/Pkg.py @@ -65,8 +65,9 @@ class PackageFilter(FileContextFilter): # export async def _access(self, path: str, mode: int = os.F_OK) -> bool: if self.__space is None: distro = await self.distro() - names = [p.name for p in await distro.select([], filter = self)] - self.__space = set(self.__add_parent_paths(await distro.pkg_paths(names))) + self.__space = set( + self.__add_parent_paths(await distro.paths(filter = self)) + ) return path in self.__space class Pkg(PackageFilter): # export diff --git a/test/unit/python/jw/pkg/lib/pf/Pkg/test.py b/test/unit/python/jw/pkg/lib/pf/Pkg/test.py index 9260a7a7..16656998 100644 --- a/test/unit/python/jw/pkg/lib/pf/Pkg/test.py +++ b/test/unit/python/jw/pkg/lib/pf/Pkg/test.py @@ -92,6 +92,16 @@ class _FakeDistro: ret.extend(files) return ret + async def paths(self, filter: Any = None, pkg_names: Any = []) -> list[str]: + ret: list[str] = [] + for p, files in self.__pkgs: + if filter is not None and not filter.match_pkg(p): + continue + if pkg_names and p.name not in pkg_names: + continue + ret.extend(files) + return ret + fake = _FakeDistro( [ (