From: Michael Tremer Date: Mon, 3 Feb 2025 10:05:29 +0000 (+0000) Subject: repos: Don't include the build service in the mirrorlist X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7f8faaf041b34672c1770191880a85de66b5f079;p=pbs.git repos: Don't include the build service in the mirrorlist pakfire will already fall back to it, if baseurl is set. Signed-off-by: Michael Tremer --- diff --git a/src/web/repos.py b/src/web/repos.py index 4db0c49f..434e6324 100644 --- a/src/web/repos.py +++ b/src/web/repos.py @@ -23,6 +23,7 @@ import configparser import os.path import pakfire import tornado.web +import urllib.parse from . import base @@ -287,22 +288,15 @@ class MirrorlistHandler(base.NoAuthMixin, BaseHandler): if not arch in pakfire.supported_arches(): raise tornado.web.HTTPError(400, "Unsupported architecture: %s" % arch) - # Fetch mirrors - mirrors = [ - { - "url" : os.path.join(mirror.url, repo.path, arch), - "location" : mirror.country_code, - } - for mirror in await self.backend.mirrors.get_mirrors_for_address(self.current_address) - ] - - # Always use the buildservice itself as last resort - mirrors.append({ - "url" : os.path.join(repo.download_url, arch), - }) - self.finish({ "type" : "mirrorlist", "version" : 1, - "mirrors" : mirrors, + "mirrors" : [ + { + "url" : urllib.parse.urljoin( + mirror.url, os.path.join("repos", repo.path, arch)), + "location" : mirror.country_code, + } + for mirror in await self.backend.mirrors.get_mirrors_for_address(self.current_address) + ], })