mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 20:54:15 +02:00
arch:using axel to pre-download source file | info window handling list attributes better
This commit is contained in:
@@ -7,35 +7,39 @@ 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) -> dict:
|
||||
depcheck = new_subprocess(['makepkg', '-L', '--check'], cwd=pkgdir)
|
||||
def check(pkgdir: str, watcher: ProcessWatcher) -> dict:
|
||||
depcheck = new_subprocess(['makepkg', '-ALcf', '--check', '--noarchive'], cwd=pkgdir)
|
||||
res = {}
|
||||
|
||||
output_lines = []
|
||||
|
||||
for o in depcheck.stdout:
|
||||
if o:
|
||||
line = o.decode().strip()
|
||||
|
||||
if line:
|
||||
output_lines.append(line)
|
||||
watcher.print(line)
|
||||
|
||||
error_lines = []
|
||||
for s in depcheck.stderr:
|
||||
if s:
|
||||
line = s.decode()
|
||||
if line:
|
||||
error_lines.append(line)
|
||||
output_lines.append(line)
|
||||
|
||||
line_strip = line.strip()
|
||||
|
||||
if line_strip:
|
||||
watcher.print(line)
|
||||
watcher.print(line_strip)
|
||||
|
||||
if error_lines:
|
||||
error_str = ''.join(error_lines)
|
||||
if output_lines:
|
||||
error_str = ''.join(output_lines)
|
||||
|
||||
if 'Missing dependencies' in 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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user