config: add pacman.repo_branch, adjust KUPFER_HTTPS url to include $arch and use repo_branch
This commit is contained in:
parent
933ffd833c
commit
232254948d
3 changed files with 7 additions and 3 deletions
|
@ -6,6 +6,8 @@ import logging
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from typing import Optional, Union, TypedDict, Any, Mapping
|
from typing import Optional, Union, TypedDict, Any, Mapping
|
||||||
|
|
||||||
|
from constants import DEFAULT_PACKAGE_BRANCH
|
||||||
|
|
||||||
CONFIG_DIR = appdirs.user_config_dir('kupfer')
|
CONFIG_DIR = appdirs.user_config_dir('kupfer')
|
||||||
CACHE_DIR = appdirs.user_cache_dir('kupfer')
|
CACHE_DIR = appdirs.user_cache_dir('kupfer')
|
||||||
|
|
||||||
|
@ -51,10 +53,11 @@ CONFIG_DEFAULTS: dict = {
|
||||||
},
|
},
|
||||||
'pkgbuilds': {
|
'pkgbuilds': {
|
||||||
'git_repo': 'https://gitlab.com/kupfer/packages/pkgbuilds.git',
|
'git_repo': 'https://gitlab.com/kupfer/packages/pkgbuilds.git',
|
||||||
'git_branch': 'dev',
|
'git_branch': DEFAULT_PACKAGE_BRANCH,
|
||||||
},
|
},
|
||||||
'pacman': {
|
'pacman': {
|
||||||
'parallel_downloads': 4,
|
'parallel_downloads': 4,
|
||||||
|
'repo_branch': DEFAULT_PACKAGE_BRANCH,
|
||||||
},
|
},
|
||||||
'paths': {
|
'paths': {
|
||||||
'cache_dir': CACHE_DIR,
|
'cache_dir': CACHE_DIR,
|
||||||
|
|
|
@ -82,7 +82,8 @@ REPOSITORIES = [
|
||||||
'phosh',
|
'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
|
Arch: TypeAlias = str
|
||||||
ARCHES = [
|
ARCHES = [
|
||||||
|
|
|
@ -56,7 +56,7 @@ def get_kupfer(arch: str, url_template: str) -> Distro:
|
||||||
|
|
||||||
|
|
||||||
def get_kupfer_https(arch: 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:
|
def get_kupfer_local(arch: Optional[str] = None, in_chroot: bool = True) -> Distro:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue