Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
svartkanin committed Dec 7, 2024
1 parent 0ef47f8 commit f021524
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ def set_mirrors(self, mirror_config: MirrorConfiguration, on_target: bool = Fals
local_pacman_conf = Path('/etc/pacman.conf')
local_mirrorlist_conf = Path('/etc/pacman.d/mirrorlist')

mirrorlist_config = mirror_config.mirrorlist_config(sorted=True)
mirrorlist_config = mirror_config.mirrorlist_config(speed_sort=True)
pacman_config = mirror_config.pacman_config()

if pacman_config:
Expand Down
4 changes: 2 additions & 2 deletions archinstall/lib/mirrors.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ def json(self) -> dict[str, Any]:
'custom_mirrors': [c.json() for c in self.custom_mirrors]
}

def mirrorlist_config(self, sorted: bool = True) -> str:
def mirrorlist_config(self, speed_sort: bool = True) -> str:
config = ''

for mirror_region in self.mirror_regions:
sorted_stati = mirror_list_handler.get_status_by_region(
mirror_region.name,
speed_sort=True
speed_sort=speed_sort
)

config += f'\n\n## {mirror_region.name}\n'
Expand Down
5 changes: 2 additions & 3 deletions archinstall/lib/models/mirrors.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import urllib.request
from dataclasses import dataclass
from pathlib import Path
from typing import Any

from pydantic import BaseModel, field_validator, model_validator

Expand Down Expand Up @@ -95,7 +94,7 @@ def latency(self) -> float | None:
return self._latency

@field_validator('score', mode='before')
def validate_score(cls, value: int) -> int | None:
def validate_score(self, value: int) -> int | None:
if value is not None:
value = round(value)
debug(f" score: {value}")
Expand Down Expand Up @@ -135,7 +134,7 @@ class MirrorRegion:
name: str
urls: list[str]

def json(self) -> dict[str, Any]:
def json(self) -> dict[str, list[str]]:
return {self.name: self.urls}

def __eq__(self, other: object) -> bool:
Expand Down

0 comments on commit f021524

Please sign in to comment.