mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 17:23:36 +02:00
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 <jan@janware.com>
This commit is contained in:
parent
84f1ad66f6
commit
cff63786e9
1 changed files with 9 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue