lib.pm: Add parameter ec: ExecContext to functions

Functions in lib.pm (i.e. run_dpkg(), run_rpm() and friends) also get
an ExecContext-type parameter. Use them in lib/distros/*/Distro.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-03-06 17:25:19 +01:00
commit 525fa34387
5 changed files with 37 additions and 27 deletions

View file

@ -29,20 +29,20 @@ class Distro(Base):
args = ['-Su']
if args.download_only:
args.append('-w')
return await self.util.pacman(args)
return await self.pacman(args)
async def _reboot_required(self, verbose: bool) -> bool:
raise NotImplementedError('distro reboot-required is not yet implemented for Arch-like distributions')
async def _select(self, names: Iterable[str]) -> Iterable[Package]:
return await query_packages(names)
raise NotImplementedError('distro select is not yet implemented for Arch-like distributions')
async def _install(self, names: Iterable[str], only_update: bool) -> None:
if only_update:
raise NotImplementedError('--only-update is not yet implemented for pacman')
args = ['-S', '--needed']
args.extend(args.packages)
await self.util.pacman(args)
await self.pacman(args)
async def _delete(self, names: Iterable[str]) -> None:
raise NotImplementedError('distro delete not yet implemented for Arch-like distributions')