[arch] fix -> not handling conflicting files errors during the installation process

This commit is contained in:
Vinicius Moreira
2020-08-27 11:14:00 -03:00
parent 60836643aa
commit 4d526e5488
11 changed files with 59 additions and 12 deletions

View File

@@ -141,12 +141,15 @@ def map_installed(names: Iterable[str] = None) -> dict: # returns a dict with w
return pkgs
def install_as_process(pkgpaths: Iterable[str], root_password: str, file: bool, pkgdir: str = '.') -> SimpleProcess:
def install_as_process(pkgpaths: Iterable[str], root_password: str, file: bool, pkgdir: str = '.', overwrite_conflicting_files: bool = False) -> SimpleProcess:
if file:
cmd = ['pacman', '-U', *pkgpaths, '--noconfirm'] # pkgpath = install file path
else:
cmd = ['pacman', '-S', *pkgpaths, '--noconfirm'] # pkgpath = pkgname
if overwrite_conflicting_files:
cmd.append('--overwrite=*')
return SimpleProcess(cmd=cmd,
root_password=root_password,
cwd=pkgdir,