diff --git a/Dockerfile b/Dockerfile index e3e9453..1d82a34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,6 +28,6 @@ RUN pip install -r requirements.txt COPY . . -RUN python -c "import constants; repos='\n'.join(['\n'.join([f'[{repo}]', f'Server = file:///prebuilts/\$repo', '']) for repo in constants.REPOSITORIES]); print(repos)" | tee /etc/pacman.d/kupfer-local +RUN python -c "import constants; repos='\n'.join(['\n'.join(['', f'[{repo}]', f'Server = file:///prebuilts/\$repo']) for repo in constants.REPOSITORIES]); print(repos)" | tee -a /etc/pacman.conf WORKDIR /src diff --git a/config.py b/config.py index 2a32d6b..db86296 100644 --- a/config.py +++ b/config.py @@ -7,7 +7,6 @@ import click CONFIG_DEFAULT_PATH = os.path.join(appdirs.user_config_dir('kupfer'), 'kupferbootstrap.toml') - PROFILE_DEFAULTS = { 'device': '', 'flavour': '', @@ -41,6 +40,7 @@ CONFIG_RUNTIME_DEFAULTS = { 'arch': None, } + def sanitize_config(conf: dict, warn_missing_defaultprofile=True) -> dict: """checks the input config dict for unknown keys and returns only the known parts""" return merge_configs(conf_new=conf, conf_base={}, warn_missing_defaultprofile=warn_missing_defaultprofile) diff --git a/constants.py b/constants.py index 6c66e70..9a3c971 100644 --- a/constants.py +++ b/constants.py @@ -47,8 +47,21 @@ ARCHES = [ 'aarch64', ] -BASE_DISTROS: { +BASE_DISTROS = { 'x86_64': { - '': '', + 'repos': { + 'core': 'http://ftp.halifax.rwth-aachen.de/archlinux/$repo/os/$arch', + 'extra': 'http://ftp.halifax.rwth-aachen.de/archlinux/$repo/os/$arch', + 'community': 'http://ftp.halifax.rwth-aachen.de/archlinux/$repo/os/$arch', + }, + }, + 'aarch64': { + 'repos': { + 'core': 'http://mirror.archlinuxarm.org/$arch/$repo', + 'extra': 'http://mirror.archlinuxarm.org/$arch/$repo', + 'community': 'http://mirror.archlinuxarm.org/$arch/$repo', + 'alarm': 'http://mirror.archlinuxarm.org/$arch/$repo', + 'aur': 'http://mirror.archlinuxarm.org/$arch/$repo', + } }, } diff --git a/distro.py b/distro.py index 8557215..f80be8d 100644 --- a/distro.py +++ b/distro.py @@ -32,7 +32,6 @@ class Repo: name: str url_template: str resolved_url: str - repo_name: str arch: str packages: dict[str, PackageInfo] options: dict[str, str] @@ -43,11 +42,10 @@ class Repo: self.remote = not self.resolved_url.startswith('file://') # TODO - def __init__(self, name: str, url_template: str, arch: str, repo_name: str, options={}, scan=True): + def __init__(self, name: str, url_template: str, arch: str, options={}, scan=True): self.name = name self.url_template = url_template self.arch = arch - self.repo_name = repo_name self.options = deepcopy(options) if scan: self.scan() @@ -86,3 +84,17 @@ class Distro: assert (repo.packages is not None) for package in repo.packages: results[package.name] = package + + +_base_distros: dict[str, Distro] = None + + +def get_base_distros() -> dict[str, Distro]: + global _base_distros + if not _base_distros: + _distros: dict[str, Distro] = {} + for arch, distro_conf in BASE_DISTROS.items(): + repos = {name: RepoInfo(url_template=url) for name, url in distro_conf['repos'].items()} + _distros[arch] = Distro(arch=arch, repo_infos=repos, scan=False) + _base_distros = _distros + return _base_distros diff --git a/packages.py b/packages.py index 9738ee2..45a6da7 100644 --- a/packages.py +++ b/packages.py @@ -354,7 +354,7 @@ def setup_dependencies_and_sources(package: Package, chroot: str, repo_dir: str makepkg_setup_args = [ '--nobuild', '--holdver', - '--nodeps' + '--nodeps', ] if (package.mode == 'cross' and enable_crosscompile): logging.info('Setting up dependencies for cross-compilation')