[arch] fix -> AUR: importing PGP keys

This commit is contained in:
Vinicius Moreira
2020-08-17 17:59:28 -03:00
parent 11540cf1e7
commit 7e0ee26db1
4 changed files with 19 additions and 4 deletions

View File

@@ -1,5 +1,14 @@
from typing import Optional
from bauh.commons.system import SystemProcess, new_subprocess
def receive_key(key: str) -> SystemProcess:
return SystemProcess(new_subprocess(['gpg', '--recv-key', key]), check_error_output=False)
def receive_key(key: str, server: Optional[str] = None) -> SystemProcess:
cmd = ['gpg']
if server:
cmd.extend(['--keyserver', server])
cmd.extend(['--recv-key', key])
return SystemProcess(new_subprocess(cmd), check_error_output=False)