[arch] feature: allowing AUR packages to be installed when bauh is launched by the root user

This commit is contained in:
Vinicius Moreira
2021-12-07 15:41:02 -03:00
parent afcc94b934
commit 6d3917ee99
21 changed files with 330 additions and 158 deletions

View File

@@ -53,10 +53,13 @@ def log_shas_and_timestamps(repo_path: str) -> Optional[List[Tuple[str, int]]]:
return logs
def clone_as_process(url: str, cwd: Optional[str], depth: int = -1) -> SimpleProcess:
def clone(url: str, target_dir: Optional[str], depth: int = -1, custom_user: Optional[str] = None) -> SimpleProcess:
cmd = ['git', 'clone', url]
if depth > 0:
cmd.append('--depth={}'.format(depth))
cmd.append(f'--depth={depth}')
return SimpleProcess(cmd=cmd, cwd=cwd)
if target_dir:
cmd.append(target_dir)
return SimpleProcess(cmd=cmd, custom_user=custom_user)