mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-09 16:44:15 +02:00
fix: AUR installation receiving GPG key
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import re
|
||||
from typing import List
|
||||
|
||||
from bauh.api.abstract.handler import ProcessWatcher
|
||||
from bauh.commons.system import new_subprocess
|
||||
|
||||
RE_DEPS_PATTERN = re.compile(r'\n?\s+->\s(.+)\n')
|
||||
RE_UNKNOWN_GPG_KEY = re.compile(r'\(unknown public key (\w+)\)')
|
||||
|
||||
|
||||
def check_missing_deps(pkgdir: str, watcher: ProcessWatcher) -> List[str]:
|
||||
def check_missing_deps(pkgdir: str, watcher: ProcessWatcher) -> dict:
|
||||
depcheck = new_subprocess(['makepkg', '-L', '--check'], cwd=pkgdir)
|
||||
|
||||
res = {}
|
||||
for o in depcheck.stdout:
|
||||
if o:
|
||||
line = o.decode().strip()
|
||||
@@ -33,4 +33,10 @@ def check_missing_deps(pkgdir: str, watcher: ProcessWatcher) -> List[str]:
|
||||
error_str = ''.join(error_lines)
|
||||
|
||||
if 'Missing dependencies' in error_str:
|
||||
return RE_DEPS_PATTERN.findall(error_str)
|
||||
res['missing_deps'] = RE_DEPS_PATTERN.findall(error_str)
|
||||
|
||||
gpg_keys = RE_UNKNOWN_GPG_KEY.findall(error_str)
|
||||
if gpg_keys:
|
||||
res['gpg_key'] = gpg_keys[0]
|
||||
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user