From 165d47f4bb3d79f405691a7cfb6ece55b33cd81c Mon Sep 17 00:00:00 2001 From: Oleksandr Zinkevych Date: Fri, 15 Oct 2021 18:21:35 +0300 Subject: Fix use_mirrors --- archinstall/lib/mirrors.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'archinstall/lib') 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') -- cgit v1.2.3-70-g09d2