From 0d9e6315f109309eb1f55e8077cfd4602f9f6fac Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 24 Apr 2020 13:46:37 -0300 Subject: [PATCH] [fix][arch] not detecting some error states during upgrade --- bauh/gems/arch/controller.py | 3 ++- bauh/gems/arch/pacman.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bauh/gems/arch/controller.py b/bauh/gems/arch/controller.py index 954421ca..00928b8c 100644 --- a/bauh/gems/arch/controller.py +++ b/bauh/gems/arch/controller.py @@ -787,7 +787,8 @@ class ArchManager(SoftwareManager): def _uninstall_pkgs(self, pkgs: Iterable[str], root_password: str, handler: ProcessHandler) -> bool: all_uninstalled, _ = handler.handle_simple(SimpleProcess(cmd=['pacman', '-R', *pkgs, '--noconfirm'], root_password=root_password, - error_phrases={'error: failed to prepare transaction'})) + error_phrases={'error: failed to prepare transaction', + 'error: failed to commit transaction'})) installed = pacman.list_installed_names() diff --git a/bauh/gems/arch/pacman.py b/bauh/gems/arch/pacman.py index 47f3ff05..1399e853 100644 --- a/bauh/gems/arch/pacman.py +++ b/bauh/gems/arch/pacman.py @@ -144,7 +144,7 @@ def install_as_process(pkgpaths: Iterable[str], root_password: str, file: bool, return SimpleProcess(cmd=cmd, root_password=root_password, cwd=pkgdir, - error_phrases={"error: failed to prepare transaction"}) + error_phrases={"error: failed to prepare transaction", 'error: failed to commit transaction'}) def list_desktop_entries(pkgnames: Set[str]) -> List[str]: @@ -697,7 +697,7 @@ def list_installed_names() -> Set[str]: def upgrade_several(pkgnames: Iterable[str], root_password: str) -> SimpleProcess: return SimpleProcess(cmd=['pacman', '-S', *pkgnames, '--noconfirm'], root_password=root_password, - error_phrases={'error: failed to prepare transaction'}) + error_phrases={'error: failed to prepare transaction', 'error: failed to commit transaction'}) def remove_several(pkgnames: Iterable[str], root_password: str) -> SystemProcess: