From 1becd281fab45254c265e3ab6f3a6ee5209bcc6c Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 11 Sep 2020 14:52:18 -0300 Subject: [PATCH] [arch] fix -> AUR: not displaying all available actions per package after a fresh install --- bauh/gems/arch/controller.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/bauh/gems/arch/controller.py b/bauh/gems/arch/controller.py index a60472ac..478e7c9f 100644 --- a/bauh/gems/arch/controller.py +++ b/bauh/gems/arch/controller.py @@ -2348,6 +2348,7 @@ class ArchManager(SoftwareManager): if res: pkg.name = install_context.name # changes the package name in case the PKGBUILD was edited + if os.path.exists(pkg.get_disk_data_path()): with open(pkg.get_disk_data_path()) as f: data = f.read() @@ -2376,14 +2377,20 @@ class ArchManager(SoftwareManager): names=installed_to_load, internet_available=True).installed - installed.extend(installed_loaded) + if installed_loaded: + installed.extend(installed_loaded) - if len(installed_loaded) + 1 != len(install_context.installed): - missing = ','.join({p for p in installed_loaded if p.name not in install_context.installed}) - self.logger.warning("Could not load all installed packages. Missing: {}".format(missing)) + if len(installed_loaded) + 1 != len(install_context.installed): + missing = ','.join({p for p in installed_loaded if p.name not in install_context.installed}) + self.logger.warning("Could not load all installed packages. Missing: {}".format(missing)) removed = [*install_context.removed.values()] if install_context.removed else [] + if installed: + downgrade_enabled = self.is_downgrade_enabled() + for p in installed: + p.downgrade_enabled = downgrade_enabled + return TransactionResult(success=res, installed=installed, removed=removed) def _install_from_repository(self, context: TransactionContext) -> bool: