]> git.ipfire.org Git - pbs.git/commitdiff
repos: Don't include the build service in the mirrorlist
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 3 Feb 2025 10:05:29 +0000 (10:05 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 3 Feb 2025 10:05:29 +0000 (10:05 +0000)
pakfire will already fall back to it, if baseurl is set.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/web/repos.py

index 4db0c49fb9c43bd06039bc7ffccc3858ce59094c..434e6324a702d2b21cd1f4cc20942806c1d04524 100644 (file)
@@ -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)
+                       ],
                })