From 34d523497751d2207f522d7e605e66743cff5f92 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Thu, 9 Dec 2021 13:37:09 -0300 Subject: [PATCH] [arch] fix: not updating the view (GUI) status correctly after uninstalling a package whose PKGBUILD file was edited --- CHANGELOG.md | 1 + bauh/gems/arch/controller.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50903d9c..efec7bd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixes - Arch + - not updating the view (GUI) status correctly after uninstalling a package whose PKGBUILD file was edited (specifically the **name**) - missing error handling when hard requirements for optional dependencies cannot be found by pacman ## [0.9.22] 2021-11-30 diff --git a/bauh/gems/arch/controller.py b/bauh/gems/arch/controller.py index a20a885b..90cd2f04 100644 --- a/bauh/gems/arch/controller.py +++ b/bauh/gems/arch/controller.py @@ -1457,7 +1457,14 @@ class ArchManager(SoftwareManager): names={pkg.name}, disk_loader=disk_loader) # to be able to return all uninstalled packages if success: - return TransactionResult(success=True, installed=None, removed=[*removed.values()] if removed else []) + removed_list = [] + + if pkg.name in removed: + pkg.installed = False + removed_list.append(pkg) + + removed_list.extend((inst for name, inst in removed.items() if name != pkg.name)) + return TransactionResult(success=not pkg.installed, installed=None, removed=removed_list) else: return TransactionResult.fail()