fix: arch -> not cleaning cached disk data when there is a conflict

This commit is contained in:
Vinicius Moreira
2019-09-19 12:21:30 -03:00
parent 78defc6184
commit a900789c9d
2 changed files with 12 additions and 2 deletions

View File

@@ -195,7 +195,17 @@ class ArchManager(SoftwareManager):
return self.install(pkg=pkg, root_password=root_password, watcher=watcher, skip_optdeps=True)
def _uninstall(self, pkg_name: str, root_password: str, handler: ProcessHandler) -> bool:
return handler.handle(SystemProcess(new_root_subprocess(['pacman', '-R', pkg_name, '--noconfirm'], root_password)))
res = handler.handle(SystemProcess(new_root_subprocess(['pacman', '-R', pkg_name, '--noconfirm'], root_password)))
if res:
cached_paths = [ArchPackage.disk_cache_path(pkg_name, 'aur'), ArchPackage.disk_cache_path(pkg_name, 'mirror')]
for path in cached_paths:
if os.path.exists(path):
shutil.rmtree(path)
break
return res
def uninstall(self, pkg: ArchPackage, root_password: str, watcher: ProcessWatcher) -> bool:
handler = ProcessHandler(watcher)

View File

@@ -692,7 +692,7 @@ class ManageWindow(QWidget):
return
self._handle_console_option(True)
self.progress_controll_enabled = len(to_update) == 1
self.progress_controll_enabled = len(to_update) == 1
self._begin_action(self.i18n['manage_window.status.upgrading'])
self.thread_update.apps_to_update = to_update
self.thread_update.root_password = pwd