|
|
@ -30,7 +30,7 @@ class PackageManager:
|
|
|
|
def __init__(self, backend):
|
|
|
|
def __init__(self, backend):
|
|
|
|
self.backend = backend
|
|
|
|
self.backend = backend
|
|
|
|
|
|
|
|
|
|
|
|
def install(self, pkgs):
|
|
|
|
def install(self, pkgs, from_local=False):
|
|
|
|
""" Installs packages.
|
|
|
|
""" Installs packages.
|
|
|
|
|
|
|
|
|
|
|
|
:param pkgs:
|
|
|
|
:param pkgs:
|
|
|
@ -53,7 +53,8 @@ class PackageManager:
|
|
|
|
elif self.backend == "apt":
|
|
|
|
elif self.backend == "apt":
|
|
|
|
check_chroot_call(["apt-get", "-q", "-y", "install"] + pkgs)
|
|
|
|
check_chroot_call(["apt-get", "-q", "-y", "install"] + pkgs)
|
|
|
|
elif self.backend == "pacman":
|
|
|
|
elif self.backend == "pacman":
|
|
|
|
check_chroot_call(["pacman", "-Sy", "--noconfirm"] + pkgs)
|
|
|
|
pacman_flags = "-U" if from_local else "-Sy"
|
|
|
|
|
|
|
|
check_chroot_call(["pacman", pacman_flags, "--noconfirm"] + pkgs)
|
|
|
|
|
|
|
|
|
|
|
|
def remove(self, pkgs):
|
|
|
|
def remove(self, pkgs):
|
|
|
|
""" Removes packages.
|
|
|
|
""" Removes packages.
|
|
|
@ -90,6 +91,8 @@ def run_operations(pkgman, entry):
|
|
|
|
pkgman.install(entry[key])
|
|
|
|
pkgman.install(entry[key])
|
|
|
|
elif key == "remove":
|
|
|
|
elif key == "remove":
|
|
|
|
pkgman.remove(entry[key])
|
|
|
|
pkgman.remove(entry[key])
|
|
|
|
|
|
|
|
elif key == "localInstall":
|
|
|
|
|
|
|
|
pkgman.install(entry[key], from_local=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def run():
|
|
|
|
def run():
|
|
|
|