config: fixes + handle mirrors migration (MR 2252)

Get rid of config.mirror_alpine and mirrors_postmarketos and make sure
they get migrated over for existing users.

mirrors_postmarketos being a list was always a bit off, but now we have
per-aports mirrors which make a lot more sense for what we're trying to
do with systemd.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-06-10 05:46:26 +02:00 committed by Oliver Smith
parent aedab4df73
commit fc010bc7c8
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
7 changed files with 44 additions and 72 deletions

View file

@ -143,7 +143,7 @@ def download(file):
"""
channel_cfg = pmb.config.pmaports.read_config_channel()
mirrordir = channel_cfg["mirrordir_alpine"]
base_url = f"{get_context().config.mirror_alpine}{mirrordir}/main/{Arch.native()}"
base_url = f"{get_context().config.mirrors["alpine"]}{mirrordir}/main/{Arch.native()}"
return pmb.helpers.http.download(f"{base_url}/{file}", file)