From 15e9edca7019f65c76ad3cddba2a7136e08db930 Mon Sep 17 00:00:00 2001 From: Kevin Kofler Date: Mon, 18 Jun 2018 13:52:07 +0200 Subject: [PATCH] [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. --- src/modules/packages/main.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/modules/packages/main.py b/src/modules/packages/main.py index 0190d474f..bffd6a945 100644 --- a/src/modules/packages/main.py +++ b/src/modules/packages/main.py @@ -155,8 +155,7 @@ class PMPackageKit(PackageManager): check_target_env_call(["pkcon", "refresh"]) def update_system(self): - # Doesn't need to update the system explicitly - pass + check_target_env_call(["pkcon", "-py", "update"]) class PMZypp(PackageManager): backend = "zypp" @@ -182,7 +181,7 @@ class PMYum(PackageManager): backend = "yum" 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): check_target_env_call(["yum", "--disablerepo=*", "-C", "-y", @@ -193,14 +192,13 @@ class PMYum(PackageManager): pass def update_system(self): - # Doesn't need to update the system explicitly - pass + check_target_env_call(["yum", "-y", "upgrade"]) class PMDnf(PackageManager): backend = "dnf" 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): # ignore the error code for now because dnf thinks removing a @@ -213,8 +211,7 @@ class PMDnf(PackageManager): pass def update_system(self): - # Doesn't need to update the system explicitly - pass + check_target_env_call(["dnf", "-y", "upgrade"]) class PMUrpmi(PackageManager):