[aur] fix config reading during dependency checking

This commit is contained in:
Vinícius Moreira
2019-12-18 18:42:38 -03:00
parent 59c6b6686f
commit 98ea92bc1f
4 changed files with 5 additions and 9 deletions

View File

@@ -3,18 +3,18 @@ import re
from typing import Tuple
from bauh.commons.system import SimpleProcess, ProcessHandler
from bauh.gems.arch import CUSTOM_MAKEPKG_PATH, should_optimize_compilation
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+)\)')
def check(pkgdir: str, handler: ProcessHandler) -> dict:
def check(pkgdir: str, optimize: bool, handler: ProcessHandler) -> dict:
res = {}
cmd = ['makepkg', '-ALcf', '--check', '--noarchive', '--nobuild', '--noprepare']
if should_optimize_compilation():
if optimize:
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))