WIP: keyring init
This commit is contained in:
parent
0c56038ed6
commit
e068b3587e
4 changed files with 57 additions and 14 deletions
|
@ -9,7 +9,7 @@ from copy import deepcopy
|
|||
from typing import ClassVar, Optional, Mapping, Union
|
||||
|
||||
from config.state import config
|
||||
from constants import Arch, BASE_DISTROS, KUPFER_HTTPS, REPOS_CONFIG_FILE, REPOSITORIES
|
||||
from constants import Arch, BASE_DISTROS, KUPFER_HTTPS, KEYRINGS_KEY, REPOS_CONFIG_FILE, REPOSITORIES
|
||||
from dictscheme import DictScheme, toml_inline_dicts, TomlPreserveInlineDictEncoder
|
||||
from utils import sha256sum
|
||||
|
||||
|
@ -39,11 +39,13 @@ class RepoConfig(AbstrRepoConfig):
|
|||
|
||||
class BaseDistro(DictScheme):
|
||||
remote_url: Optional[str]
|
||||
keyrings: Optional[list[str]]
|
||||
repos: dict[str, BaseDistroRepo]
|
||||
|
||||
|
||||
class ReposConfigFile(DictScheme):
|
||||
remote_url: Optional[str]
|
||||
keyrings: Optional[list[str]]
|
||||
repos: dict[str, RepoConfig]
|
||||
base_distros: dict[Arch, BaseDistro]
|
||||
_path: Optional[str]
|
||||
|
@ -106,6 +108,7 @@ REPOS_CONFIG_DEFAULT = ReposConfigFile({
|
|||
'_path': '__DEFAULTS__',
|
||||
'_checksum': None,
|
||||
REMOTEURL_KEY: KUPFER_HTTPS,
|
||||
KEYRINGS_KEY: [],
|
||||
REPOS_KEY: {
|
||||
'kupfer_local': REPO_DEFAULTS | {
|
||||
LOCALONLY_KEY: True
|
||||
|
@ -117,11 +120,10 @@ REPOS_CONFIG_DEFAULT = ReposConfigFile({
|
|||
BASEDISTROS_KEY: {
|
||||
arch: {
|
||||
REMOTEURL_KEY: None,
|
||||
'repos': {
|
||||
k: {
|
||||
'remote_url': v
|
||||
} for k, v in arch_def['repos'].items()
|
||||
},
|
||||
KEYRINGS_KEY: arch_def.get(KEYRINGS_KEY, None),
|
||||
'repos': {k: {
|
||||
'remote_url': v
|
||||
} for k, v in arch_def['repos'].items()}, # type: ignore[union-attr]
|
||||
} for arch, arch_def in BASE_DISTROS.items()
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue