mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-09 04:04:15 +02:00
[arch] fix: installation fails when several dependent packages conflict with the installed ones
This commit is contained in:
@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
- Arch
|
- Arch
|
||||||
- silent crash when handling and displaying transaction sub-status
|
- silent crash when handling and displaying transaction sub-status
|
||||||
- AUR: not detecting installed packages anymore due to recent AUR API changes
|
- AUR: not detecting installed packages anymore due to recent AUR API changes
|
||||||
|
- installation fails when several dependent packages conflict with the installed ones
|
||||||
|
|
||||||
- AppImage
|
- AppImage
|
||||||
- search: displaying duplicate installed apps for some cases
|
- search: displaying duplicate installed apps for some cases
|
||||||
|
|||||||
@@ -1322,9 +1322,13 @@ class ArchManager(SoftwareManager):
|
|||||||
else:
|
else:
|
||||||
instances = None
|
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)
|
uninstalled = self._uninstall_pkgs(to_uninstall, context.root_password, context.handler, ignore_dependencies=skip_requirements)
|
||||||
|
|
||||||
if uninstalled:
|
if uninstalled:
|
||||||
|
self._remove_uninstalled_from_context(provided_by_uninstalled, context)
|
||||||
|
|
||||||
if disk_loader: # loading package instances in case the uninstall succeeds
|
if disk_loader: # loading package instances in case the uninstall succeeds
|
||||||
if instances:
|
if instances:
|
||||||
for p in instances:
|
for p in instances:
|
||||||
@@ -1395,6 +1399,22 @@ class ArchManager(SoftwareManager):
|
|||||||
self._update_progress(context, 100)
|
self._update_progress(context, 100)
|
||||||
return uninstalled
|
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:
|
def uninstall(self, pkg: ArchPackage, root_password: str, watcher: ProcessWatcher, disk_loader: DiskCacheLoader) -> TransactionResult:
|
||||||
self.aur_client.clean_caches()
|
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,
|
res = self._uninstall(context=context, names={conflicting_pkg}, disk_loader=context.disk_loader,
|
||||||
remove_unneeded=False, skip_requirements=skip_requirements)
|
remove_unneeded=False, skip_requirements=skip_requirements)
|
||||||
|
|
||||||
|
|
||||||
context.restabilish_progress()
|
context.restabilish_progress()
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user