mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-25 17:45:55 +02:00
lib.distros.*.Distro: Align PM prototypes
Make all backend package manager prototypes have the same arguments: yum(self, args: list[str], verbose: bool=True, sudo: bool=True) This also implies having them behave equally verbose, unless otherwise specified by the caller. This changes the default for Debian. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
9cd5ef2b98
commit
824de4eca4
3 changed files with 9 additions and 6 deletions
|
|
@ -12,12 +12,14 @@ if TYPE_CHECKING:
|
|||
|
||||
class Distro(Base):
|
||||
|
||||
async def pacman(self, args: list[str]) -> Result:
|
||||
async def pacman(self, args: list[str], verbose: bool=True, sudo: bool=True) -> Result:
|
||||
cmd = ['/usr/bin/pacman']
|
||||
if not self.interactive:
|
||||
cmd.extend(['--noconfirm'])
|
||||
cmd.extend(args)
|
||||
return await self.sudo(cmd)
|
||||
if sudo:
|
||||
return await self.sudo(cmd, verbose=verbose)
|
||||
return await self.run(cmd, verbose=verbose)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue