index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-10-27 11:52:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-27 11:52:44 +0200 |
commit | ae0d700c7e0577cd2a65b69541bbf053c3985136 (patch) | |
tree | 58dbdc5497564d2e6d2a851f05d18cb57bf7b8f5 /archinstall/lib/mirrors.py | |
parent | 72849083e611486d4a3d141b30c7ad7f2b986cec (diff) | |
parent | a822b8edae2c80edc86e786e27d876b705b5c985 (diff) |
-rw-r--r-- | archinstall/lib/mirrors.py | 12 |
diff --git a/archinstall/lib/mirrors.py b/archinstall/lib/mirrors.py index 1b62a61b..739bf1a8 100644 --- a/archinstall/lib/mirrors.py +++ b/archinstall/lib/mirrors.py @@ -1,6 +1,6 @@ import urllib.error import urllib.request -from typing import Union +from typing import Union, Mapping, Iterable from .general import * from .output import log @@ -113,14 +113,16 @@ def insert_mirrors(mirrors, *args, **kwargs): return True -def use_mirrors(regions: dict, destination='/etc/pacman.d/mirrorlist'): +def use_mirrors( + regions: Mapping[str, Iterable[str]], + destination: str ='/etc/pacman.d/mirrorlist' +) -> None: log(f'A new package mirror-list has been created: {destination}', level=logging.INFO) - for region, mirrors in regions.items(): - with open(destination, 'w') as mirrorlist: + with open(destination, 'w') as mirrorlist: + for region, mirrors in regions.items(): for mirror in mirrors: mirrorlist.write(f'## {region}\n') mirrorlist.write(f'Server = {mirror}\n') - return True def re_rank_mirrors(top=10, *positionals, **kwargs): |