[fix][arch] not stopping the upgrade process if a transaction error happens

This commit is contained in:
Vinícius Moreira
2020-04-20 10:46:26 -03:00
parent efd4179b7e
commit 7b07ce0cab
4 changed files with 23 additions and 5 deletions

View File

@@ -741,7 +741,7 @@ class ArchManager(SoftwareManager):
disk.save_several(repo_pkgs_names, repo_map=repo_map, overwrite=True, maintainer=None)
else:
self.logger.error("'pacman' returned an unexpected response after upgrading the repository packages")
self.logger.error("'pacman' returned an unexpected response or error phrase after upgrading the repository packages")
return False
except:
watcher.change_substatus('')

View File

@@ -141,7 +141,10 @@ def install_as_process(pkgpaths: Iterable[str], root_password: str, file: bool,
else:
cmd = ['pacman', '-S', *pkgpaths, '--noconfirm'] # pkgpath = pkgname
return SimpleProcess(cmd=cmd, root_password=root_password, cwd=pkgdir)
return SimpleProcess(cmd=cmd,
root_password=root_password,
cwd=pkgdir,
error_phrases={"error: failed to prepare transaction"})
def list_desktop_entries(pkgnames: Set[str]) -> List[str]:
@@ -692,7 +695,9 @@ def list_installed_names() -> Set[str]:
def upgrade_several(pkgnames: Iterable[str], root_password: str) -> SimpleProcess:
return SimpleProcess(cmd=['pacman', '-S', *pkgnames, '--noconfirm'], root_password=root_password)
return SimpleProcess(cmd=['pacman', '-S', *pkgnames, '--noconfirm'],
root_password=root_password,
error_phrases={'error: failed to prepare transaction'})
def remove_several(pkgnames: Iterable[str], root_password: str) -> SystemProcess: