[arch] feature: allowing AUR packages to be installed when bauh is launched by the root user

This commit is contained in:
Vinicius Moreira
2021-12-07 15:41:02 -03:00
parent afcc94b934
commit 6d3917ee99
21 changed files with 330 additions and 158 deletions

View File

@@ -1,11 +1,11 @@
import os
from typing import Optional
from bauh import __app_name__
from bauh.api.paths import CONFIG_DIR, TEMP_DIR, CACHE_DIR
from bauh.api.paths import CONFIG_DIR, TEMP_DIR, CACHE_DIR, get_temp_dir
from bauh.commons import resource
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
BUILD_DIR = f'{TEMP_DIR}/arch'
ARCH_CACHE_DIR = f'{CACHE_DIR}/arch'
CATEGORIES_FILE_PATH = f'{ARCH_CACHE_DIR}/categories.txt'
URL_CATEGORIES_FILE = f'https://raw.githubusercontent.com/vinifmor/{__app_name__}-files/master/arch/categories.txt'
@@ -21,6 +21,10 @@ EDITABLE_PKGBUILDS_FILE = f'{ARCH_CONFIG_DIR}/aur/editable_pkgbuilds.txt'
IGNORED_REBUILD_CHECK_FILE = f'{ARCH_CONFIG_DIR}/aur/ignored_rebuild_check.txt'
def get_pkgbuild_dir(user: Optional[str] = None) -> str:
return f'{get_temp_dir(user) if user else TEMP_DIR}/arch'
def get_icon_path() -> str:
return resource.get_path('img/arch.svg', ROOT_DIR)