From cff63786e90a02aadf7602cfb8403eafca184bc7 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sun, 15 Mar 2026 15:14:56 +0100 Subject: [PATCH] lib.Distro: Allow empty packages list In commands taking lists of packages, namely install, delete and pkg_files, don't bother asking the backend. Uniformly log a warning and return successfully. Signed-off-by: Jan Lindemann --- src/python/jw/pkg/lib/Distro.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/python/jw/pkg/lib/Distro.py b/src/python/jw/pkg/lib/Distro.py index 34920f28..e4fb9e2c 100644 --- a/src/python/jw/pkg/lib/Distro.py +++ b/src/python/jw/pkg/lib/Distro.py @@ -113,6 +113,9 @@ class Distro(abc.ABC): pass async def install(self, names: Iterable[str], only_update: bool=False) -> None: + if not names: + log(WARNING, f'No packages specified for installation') + return return await self._install(names, only_update=only_update) # -- delete @@ -122,6 +125,9 @@ class Distro(abc.ABC): pass async def delete(self, names: Iterable[str]) -> None: + if not names: + log(WARNING, f'No packages specified for deletion') + return return await self._delete(names) # -- pkg_files @@ -131,4 +137,7 @@ class Distro(abc.ABC): pass async def pkg_files(self, name: str) -> Iterable[str]: + if not names: + log(WARNING, f'No packages specified for inspection') + return [] return await self._pkg_files(name)