From b4eb7049d599dfdcdf34550dea11c108f57bffb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Moreira?= Date: Fri, 8 May 2020 18:03:08 -0300 Subject: [PATCH] [fix][arch] upgrading progress when conflicting files are detected --- CHANGELOG.md | 1 + bauh/gems/arch/controller.py | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 689b4624..a9bdd8d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixes - Arch - 'clean cache' operation was not working in some scenarios + - upgrading progress when conflicting files are detected - upgrade: crashing for scenarios when there are packages that cannot upgrade to be displayed on the summary window - settings: crashing when an empty Qt style is defined [#104](https://github.com/vinifmor/bauh/issues/104) diff --git a/bauh/gems/arch/controller.py b/bauh/gems/arch/controller.py index 1997ea2b..7b32165d 100644 --- a/bauh/gems/arch/controller.py +++ b/bauh/gems/arch/controller.py @@ -710,9 +710,10 @@ class ArchManager(SoftwareManager): return files - def _upgrade_repo_pkgs(self, pkgs: List[str], handler: ProcessHandler, root_password: str, overwrite_files: bool = False) -> bool: + def _upgrade_repo_pkgs(self, pkgs: List[str], handler: ProcessHandler, root_password: str, overwrite_files: bool = False, + status_handler: TransactionStatusHandler = None) -> bool: try: - output_handler = TransactionStatusHandler(handler.watcher, self.i18n, len(pkgs), self.logger) + output_handler = TransactionStatusHandler(handler.watcher, self.i18n, len(pkgs), self.logger) if not status_handler else status_handler output_handler.start() success, upgrade_output = handler.handle_simple(pacman.upgrade_several(pkgnames=pkgs, root_password=root_password, @@ -737,7 +738,11 @@ class ArchManager(SoftwareManager): confirmation_label=self.i18n['arch.upgrade.conflicting_files.stop'], components=files): - return self._upgrade_repo_pkgs(pkgs=pkgs, handler=handler, root_password=root_password, overwrite_files=True) + return self._upgrade_repo_pkgs(pkgs=pkgs, + handler=handler, + root_password=root_password, + overwrite_files=True, + status_handler=output_handler) else: handler.watcher.print("Aborted by the user") return False