mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-06 22:54:16 +02:00
[aur] respecting BAUH_ARCH_OPTIMIZE when makepkg calls are executed
This commit is contained in:
@@ -3,7 +3,7 @@ import re
|
||||
from typing import Tuple
|
||||
|
||||
from bauh.commons.system import SimpleProcess, ProcessHandler
|
||||
from bauh.gems.arch import CUSTOM_MAKEPKG_PATH
|
||||
from bauh.gems.arch import CUSTOM_MAKEPKG_PATH, should_optimize_compilation
|
||||
|
||||
RE_DEPS_PATTERN = re.compile(r'\n?\s+->\s(.+)\n')
|
||||
RE_UNKNOWN_GPG_KEY = re.compile(r'\(unknown public key (\w+)\)')
|
||||
@@ -14,9 +14,12 @@ def check(pkgdir: str, handler: ProcessHandler) -> dict:
|
||||
|
||||
cmd = ['makepkg', '-ALcf', '--check', '--noarchive', '--nobuild', '--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))
|
||||
if should_optimize_compilation():
|
||||
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))
|
||||
else:
|
||||
handler.watcher.print('Custom optimized makepkg.conf ( {} ) not found'.format(CUSTOM_MAKEPKG_PATH))
|
||||
|
||||
success, output = handler.handle_simple(SimpleProcess(cmd, cwd=pkgdir))
|
||||
|
||||
@@ -37,9 +40,11 @@ def check(pkgdir: str, handler: ProcessHandler) -> dict:
|
||||
def make(pkgdir: str, handler: ProcessHandler) -> Tuple[bool, str]:
|
||||
cmd = ['makepkg', '-ALcsmf']
|
||||
|
||||
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))
|
||||
if should_optimize_compilation():
|
||||
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))
|
||||
else:
|
||||
handler.watcher.print('Custom optimized makepkg.conf ( {} ) not found'.format(CUSTOM_MAKEPKG_PATH))
|
||||
|
||||
return handler.handle_simple(SimpleProcess(cmd, cwd=pkgdir))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user