mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-25 09:35:54 +02:00
jw.pkg.cmds.distro.backend.suse: Add Module
Add backend code for package managing on OpenSUSE Tumbleweed, Slowroll, LEAP, SLES and SLED. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
58e56648d2
commit
3ca544a32d
5 changed files with 62 additions and 0 deletions
16
src/python/jw/pkg/cmds/distro/backend/suse/Base.py
Normal file
16
src/python/jw/pkg/cmds/distro/backend/suse/Base.py
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from ...Cmd import Cmd
|
||||||
|
from ..BackendCmd import BackendCmd
|
||||||
|
|
||||||
|
class Base(BackendCmd):
|
||||||
|
|
||||||
|
def __init__(self, parent: Cmd):
|
||||||
|
super().__init__(parent)
|
||||||
|
|
||||||
|
async def zypper(self, *args):
|
||||||
|
cmd = ['/usr/bin/zypper']
|
||||||
|
if not self.interactive:
|
||||||
|
cmd.extend(['--non-interactive', '--gpg-auto-import-keys', '--no-gpg-checks'])
|
||||||
|
cmd.extend(args)
|
||||||
|
return await self._sudo(cmd)
|
||||||
14
src/python/jw/pkg/cmds/distro/backend/suse/Dup.py
Normal file
14
src/python/jw/pkg/cmds/distro/backend/suse/Dup.py
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from argparse import Namespace
|
||||||
|
|
||||||
|
from ...Cmd import Cmd
|
||||||
|
from .Base import Base
|
||||||
|
|
||||||
|
class Dup(Base):
|
||||||
|
|
||||||
|
def __init__(self, parent: Cmd):
|
||||||
|
super().__init__(parent)
|
||||||
|
|
||||||
|
async def run(self, args: Namespace):
|
||||||
|
return await self.zypper('dup', '--force-resolution', '--auto-agree-with-licenses')
|
||||||
14
src/python/jw/pkg/cmds/distro/backend/suse/Install.py
Normal file
14
src/python/jw/pkg/cmds/distro/backend/suse/Install.py
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from argparse import Namespace
|
||||||
|
|
||||||
|
from ...Cmd import Cmd
|
||||||
|
from .Base import Base
|
||||||
|
|
||||||
|
class Install(Base):
|
||||||
|
|
||||||
|
def __init__(self, parent: Cmd):
|
||||||
|
super().__init__(parent)
|
||||||
|
|
||||||
|
async def run(self, args: Namespace):
|
||||||
|
return await self.zypper('install', *args.packages)
|
||||||
4
src/python/jw/pkg/cmds/distro/backend/suse/Makefile
Normal file
4
src/python/jw/pkg/cmds/distro/backend/suse/Makefile
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
TOPDIR = ../../../../../../../..
|
||||||
|
|
||||||
|
include $(TOPDIR)/make/proj.mk
|
||||||
|
include $(JWBDIR)/make/py-mod.mk
|
||||||
14
src/python/jw/pkg/cmds/distro/backend/suse/Refresh.py
Normal file
14
src/python/jw/pkg/cmds/distro/backend/suse/Refresh.py
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from argparse import Namespace
|
||||||
|
|
||||||
|
from ...Cmd import Cmd
|
||||||
|
from .Base import Base
|
||||||
|
|
||||||
|
class Refresh(Base):
|
||||||
|
|
||||||
|
def __init__(self, parent: Cmd):
|
||||||
|
super().__init__(parent)
|
||||||
|
|
||||||
|
async def run(self, args: Namespace):
|
||||||
|
return await self.zypper('refresh')
|
||||||
Loading…
Add table
Add a link
Reference in a new issue