diff --git a/CHANGELOG.md b/CHANGELOG.md index ed69c3b6..03c1b544 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Arch - silent crash when handling and displaying transaction sub-status - AUR: not detecting installed packages anymore due to recent AUR API changes + - installation fails when several dependent packages conflict with the installed ones - AppImage - search: displaying duplicate installed apps for some cases diff --git a/bauh/gems/arch/controller.py b/bauh/gems/arch/controller.py index a93d9442..942d631d 100644 --- a/bauh/gems/arch/controller.py +++ b/bauh/gems/arch/controller.py @@ -1322,9 +1322,13 @@ class ArchManager(SoftwareManager): else: instances = None + provided_by_uninstalled = pacman.map_provided(pkgs=to_uninstall) + uninstalled = self._uninstall_pkgs(to_uninstall, context.root_password, context.handler, ignore_dependencies=skip_requirements) if uninstalled: + self._remove_uninstalled_from_context(provided_by_uninstalled, context) + if disk_loader: # loading package instances in case the uninstall succeeds if instances: for p in instances: @@ -1395,6 +1399,22 @@ class ArchManager(SoftwareManager): self._update_progress(context, 100) return uninstalled + def _remove_uninstalled_from_context(self, provided_by_uninstalled: Dict[str, Set[str]], context: TransactionContext): + if context.provided_map and provided_by_uninstalled: # updating the current provided context + for name, provided in provided_by_uninstalled.items(): + if name in context.provided_map: + del context.provided_map[name] + + if provided: + for exp in provided: + exp_provided = context.provided_map.get(exp) + + if exp_provided and name in exp_provided: + exp_provided.remove(name) + + if not exp_provided: + del context.provided_map[exp] + def uninstall(self, pkg: ArchPackage, root_password: str, watcher: ProcessWatcher, disk_loader: DiskCacheLoader) -> TransactionResult: self.aur_client.clean_caches() @@ -1703,6 +1723,8 @@ class ArchManager(SoftwareManager): res = self._uninstall(context=context, names={conflicting_pkg}, disk_loader=context.disk_loader, remove_unneeded=False, skip_requirements=skip_requirements) + + context.restabilish_progress() return res