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)