index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Oleksandr Zinkevych <zso040399@gmail.com> | 2021-10-15 18:21:35 +0300 |
---|---|---|
committer | Oleksandr Zinkevych <zso040399@gmail.com> | 2021-10-15 18:21:35 +0300 |
commit | 165d47f4bb3d79f405691a7cfb6ece55b33cd81c (patch) | |
tree | 49bf15f3f389c08c1edfdaa44dda32c6b8501da9 /archinstall/lib/mirrors.py | |
parent | ba725517fd290a60cd4e1ea570dbbf94a47ede05 (diff) |
-rw-r--r-- | archinstall/lib/mirrors.py | 11 |
diff --git a/archinstall/lib/mirrors.py b/archinstall/lib/mirrors.py index 1b62a61b..12fa7450 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,10 +113,13 @@ 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' +) -> bool: 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') |