[packages]: Implement update_system for pkcon, yum, dnf

Also make install for yum and dnf follow the documented syntax: options
(-y) before the command (install), even though yum and dnf also accept
the other order. This also makes it consistent with remove.
This commit is contained in:
Kevin Kofler 2018-06-18 13:52:07 +02:00
parent c822627bec
commit 15e9edca70

View File

@ -155,8 +155,7 @@ class PMPackageKit(PackageManager):
check_target_env_call(["pkcon", "refresh"]) check_target_env_call(["pkcon", "refresh"])
def update_system(self): def update_system(self):
# Doesn't need to update the system explicitly check_target_env_call(["pkcon", "-py", "update"])
pass
class PMZypp(PackageManager): class PMZypp(PackageManager):
backend = "zypp" backend = "zypp"
@ -182,7 +181,7 @@ class PMYum(PackageManager):
backend = "yum" backend = "yum"
def install(self, pkgs, from_local=False): def install(self, pkgs, from_local=False):
check_target_env_call(["yum", "install", "-y"] + pkgs) check_target_env_call(["yum", "-y", "install"] + pkgs)
def remove(self, pkgs): def remove(self, pkgs):
check_target_env_call(["yum", "--disablerepo=*", "-C", "-y", check_target_env_call(["yum", "--disablerepo=*", "-C", "-y",
@ -193,14 +192,13 @@ class PMYum(PackageManager):
pass pass
def update_system(self): def update_system(self):
# Doesn't need to update the system explicitly check_target_env_call(["yum", "-y", "upgrade"])
pass
class PMDnf(PackageManager): class PMDnf(PackageManager):
backend = "dnf" backend = "dnf"
def install(self, pkgs, from_local=False): def install(self, pkgs, from_local=False):
check_target_env_call(["dnf", "install", "-y"] + pkgs) check_target_env_call(["dnf", "-y", "install"] + pkgs)
def remove(self, pkgs): def remove(self, pkgs):
# ignore the error code for now because dnf thinks removing a # ignore the error code for now because dnf thinks removing a
@ -213,8 +211,7 @@ class PMDnf(PackageManager):
pass pass
def update_system(self): def update_system(self):
# Doesn't need to update the system explicitly check_target_env_call(["dnf", "-y", "upgrade"])
pass
class PMUrpmi(PackageManager): class PMUrpmi(PackageManager):