diff --git a/config.py b/config.py index 97b36e2..d14c25d 100644 --- a/config.py +++ b/config.py @@ -6,6 +6,8 @@ import logging from copy import deepcopy from typing import Optional, Union, TypedDict, Any, Mapping +from constants import DEFAULT_PACKAGE_BRANCH + CONFIG_DIR = appdirs.user_config_dir('kupfer') CACHE_DIR = appdirs.user_cache_dir('kupfer') @@ -51,10 +53,11 @@ CONFIG_DEFAULTS: dict = { }, 'pkgbuilds': { 'git_repo': 'https://gitlab.com/kupfer/packages/pkgbuilds.git', - 'git_branch': 'dev', + 'git_branch': DEFAULT_PACKAGE_BRANCH, }, 'pacman': { 'parallel_downloads': 4, + 'repo_branch': DEFAULT_PACKAGE_BRANCH, }, 'paths': { 'cache_dir': CACHE_DIR, diff --git a/constants.py b/constants.py index d281694..cfcc5a0 100644 --- a/constants.py +++ b/constants.py @@ -82,7 +82,8 @@ REPOSITORIES = [ 'phosh', ] -KUPFER_HTTPS = 'https://gitlab.com/kupfer/packages/prebuilts/-/raw/main/$repo' +DEFAULT_PACKAGE_BRANCH = 'dev' +KUPFER_HTTPS = 'https://gitlab.com/kupfer/packages/prebuilts/-/raw/%branch%/$arch/$repo' Arch: TypeAlias = str ARCHES = [ diff --git a/distro/distro.py b/distro/distro.py index 21afe4c..49c57bb 100644 --- a/distro/distro.py +++ b/distro/distro.py @@ -56,7 +56,7 @@ def get_kupfer(arch: str, url_template: str) -> Distro: def get_kupfer_https(arch: str) -> Distro: - return get_kupfer(arch, KUPFER_HTTPS) + return get_kupfer(arch, KUPFER_HTTPS.replace('%branch%', config.file['pacman']['repo_branch'])) def get_kupfer_local(arch: Optional[str] = None, in_chroot: bool = True) -> Distro: