import os.path
import pakfire
import tornado.web
+import urllib.parse
from . import base
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)
+ ],
})