mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-06 21:44:16 +02:00
[improvement][aur] generating the optimized makepkg.conf at ~/.config/bauh/arch and using it as a build parameter
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import os
|
||||
import re
|
||||
from typing import Tuple
|
||||
|
||||
from bauh.commons.system import SimpleProcess, ProcessHandler
|
||||
from bauh.gems.arch import CUSTOM_MAKEPKG_PATH
|
||||
|
||||
RE_DEPS_PATTERN = re.compile(r'\n?\s+->\s(.+)\n')
|
||||
RE_UNKNOWN_GPG_KEY = re.compile(r'\(unknown public key (\w+)\)')
|
||||
@@ -8,7 +11,14 @@ RE_UNKNOWN_GPG_KEY = re.compile(r'\(unknown public key (\w+)\)')
|
||||
|
||||
def check(pkgdir: str, handler: ProcessHandler) -> dict:
|
||||
res = {}
|
||||
success, output = handler.handle_simple(SimpleProcess(['makepkg', '-ALcf', '--check', '--noarchive', '--nobuild'], cwd=pkgdir))
|
||||
|
||||
cmd = ['makepkg', '-ALcf', '--check', '--noarchive', '--nobuild']
|
||||
|
||||
if os.path.exists(CUSTOM_MAKEPKG_PATH):
|
||||
handler.watcher.print('Using custom makepkg.conf -> {}'.format(CUSTOM_MAKEPKG_PATH))
|
||||
cmd.append('--config={}'.format(CUSTOM_MAKEPKG_PATH))
|
||||
|
||||
success, output = handler.handle_simple(SimpleProcess(cmd, cwd=pkgdir))
|
||||
|
||||
if 'Missing dependencies' in output:
|
||||
res['missing_deps'] = RE_DEPS_PATTERN.findall(output)
|
||||
@@ -22,3 +32,14 @@ def check(pkgdir: str, handler: ProcessHandler) -> dict:
|
||||
res['validity_check'] = True
|
||||
|
||||
return res
|
||||
|
||||
|
||||
def make(pkgdir: str, handler: ProcessHandler) -> Tuple[bool, str]:
|
||||
cmd = ['makepkg', '-ALcsmf', '--noprepare']
|
||||
|
||||
if os.path.exists(CUSTOM_MAKEPKG_PATH):
|
||||
handler.watcher.print('Using custom makepkg.conf -> {}'.format(CUSTOM_MAKEPKG_PATH))
|
||||
cmd.append('--config={}'.format(CUSTOM_MAKEPKG_PATH))
|
||||
|
||||
return handler.handle_simple(SimpleProcess(cmd, cwd=pkgdir))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user