lib.Distro.pkg_files(): Take list[str] | None
Distro.pkg_files() takes a package name and returns a list of files in that package. This commit generalizes that - pass None to it and get the list of all packaged files in the system, and pass a list of strings to retrieve all files belonging to the named packages. The same arguments are propagated to _pkg_files(), which in turn propagates them to list_files(). This allows faster generation of file lists than before. Having to retrieve a list of matching packages and query each package for its contained files can be collapsed into one or two backend calls. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
63f0fef12e
commit
2fad5d189c
1 changed files with 73 additions and 30 deletions
|
|
@ -56,7 +56,7 @@ class DummyDistro(Distro):
|
|||
pass
|
||||
|
||||
@override
|
||||
async def _pkg_files(self, name: str) -> Iterable[str]:
|
||||
async def _pkg_files(self, names: list[str] | None) -> Iterable[str]:
|
||||
return []
|
||||
|
||||
def distro(os_release_str: str) -> Distro:
|
||||
|
|
|
|||
Loading…
Reference in a new issue