[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

@@ -12,7 +12,3 @@ CONFIG_DIR = '{}/.config/bauh/arch'.format(HOME_PATH)
CUSTOM_MAKEPKG_PATH = '{}/makepkg.conf'.format(CONFIG_DIR)
AUR_INDEX_FILE = '{}/aur.txt'.format(BUILD_DIR)
CONFIG_FILE = '{}/arch.yml'.format(CONFIG_PATH)
def should_optimize_compilation() -> bool:
return bool(int(os.getenv('BAUH_ARCH_OPTIMIZE', 1)))

View File

@@ -528,7 +528,7 @@ class ArchManager(SoftwareManager):
def _handle_deps_and_keys(self, pkgname: str, root_password: str, handler: ProcessHandler, pkgdir: str, check_subdeps: bool = True) -> bool:
handler.watcher.change_substatus(self.i18n['arch.checking.deps'].format(bold(pkgname)))
check_res = makepkg.check(pkgdir, handler)
check_res = makepkg.check(pkgdir, optimize=self.local_config['optimize'], handler=handler)
if check_res:
if check_res.get('missing_deps'):

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))

View File

@@ -8,7 +8,7 @@ from threading import Thread
import requests
from bauh.api.abstract.context import ApplicationContext
from bauh.gems.arch import pacman, disk, CUSTOM_MAKEPKG_PATH, CONFIG_DIR, should_optimize_compilation, BUILD_DIR, \
from bauh.gems.arch import pacman, disk, CUSTOM_MAKEPKG_PATH, CONFIG_DIR, BUILD_DIR, \
AUR_INDEX_FILE, config
URL_INDEX = 'https://aur.archlinux.org/packages.gz'