[arch] improvement -> upgrade: allowing the user to bypass dependency breakage scenarios

This commit is contained in:
Vinicius Moreira
2020-09-02 12:11:26 -03:00
parent fb2c062226
commit 2b652532be
11 changed files with 84 additions and 7 deletions

View File

@@ -707,12 +707,15 @@ def map_updates_data(pkgs: Iterable[str], files: bool = False) -> dict:
return res
def upgrade_several(pkgnames: Iterable[str], root_password: str, overwrite_conflicting_files: bool = False) -> SimpleProcess:
def upgrade_several(pkgnames: Iterable[str], root_password: str, overwrite_conflicting_files: bool = False, skip_dependency_checks: bool = False) -> SimpleProcess:
cmd = ['pacman', '-S', *pkgnames, '--noconfirm']
if overwrite_conflicting_files:
cmd.append('--overwrite=*')
if skip_dependency_checks:
cmd.append('-d')
return SimpleProcess(cmd=cmd,
root_password=root_password,
error_phrases={'error: failed to prepare transaction', 'error: failed to commit transaction', 'error: target not found'},