pf.Pkg._access(): Use Distro.paths()
Distro.paths() now allows to spare a detour in Pkg._access() - we can directly get to the list of paths instead of via Distro.select() -> pkg_paths(). Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
dc9ef58c8b
commit
ea751d3949
1 changed files with 13 additions and 2 deletions
|
|
@ -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(
|
||||
[
|
||||
(
|
||||
|
|
|
|||
Loading…
Reference in a new issue