mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-29 18:35:37 -04:00
[PEP 8] General Style Part 2
This commit is contained in:
parent
d8df3d7a59
commit
09dc6bb5d7
6 changed files with 26 additions and 15 deletions
|
@ -21,6 +21,7 @@
|
|||
import libcalamares
|
||||
from libcalamares.utils import check_chroot_call, chroot_call
|
||||
|
||||
|
||||
class PackageManager:
|
||||
def __init__(self, backend):
|
||||
self.backend = backend
|
||||
|
@ -30,13 +31,17 @@ class PackageManager:
|
|||
for pkg in pkgs:
|
||||
check_chroot_call(["pkcon", "-py", "install", pkg])
|
||||
elif self.backend == "zypp":
|
||||
check_chroot_call(["zypper", "--non-interactive", "--quiet-install", "install", "--auto-agree-with-licenses", "install"] + pkgs)
|
||||
check_chroot_call(
|
||||
["zypper", "--non-interactive", "--quiet-install", "install",
|
||||
"--auto-agree-with-licenses", "install"] + pkgs)
|
||||
elif self.backend == "yum":
|
||||
check_chroot_call(["yum", "install", "-y"] + pkgs)
|
||||
elif self.backend == "dnf":
|
||||
check_chroot_call(["dnf", "install", "-y"] + pkgs)
|
||||
elif self.backend == "urpmi":
|
||||
check_chroot_call(["urpmi", "--download-all", "--no-suggests", "--no-verify-rpm", "--fastunsafe", "--ignoresize", "--nolock", "--auto"] + pkgs)
|
||||
check_chroot_call(
|
||||
["urpmi", "--download-all", "--no-suggests", "--no-verify-rpm",
|
||||
"--fastunsafe", "--ignoresize", "--nolock", "--auto"] + pkgs)
|
||||
elif self.backend == "apt":
|
||||
check_chroot_call(["apt-get", "-q", "-y", "install"] + pkgs)
|
||||
elif self.backend == "pacman":
|
||||
|
@ -61,6 +66,7 @@ class PackageManager:
|
|||
elif self.backend == "pacman":
|
||||
check_chroot_call(["pacman", "-Rs", "--noconfirm"] + pkgs)
|
||||
|
||||
|
||||
def run_operations(pkgman, entry):
|
||||
for key in entry.keys():
|
||||
if key == "install":
|
||||
|
@ -68,6 +74,7 @@ def run_operations(pkgman, entry):
|
|||
elif key == "remove":
|
||||
pkgman.remove(entry[key])
|
||||
|
||||
|
||||
def run():
|
||||
backend = libcalamares.job.configuration.get("backend")
|
||||
if backend not in ("packagekit", "zypp", "yum", "dnf", "urpmi", "apt", "pacman"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue