Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorOleksandr Zinkevych <zso040399@gmail.com>2021-10-15 18:21:35 +0300
committerOleksandr Zinkevych <zso040399@gmail.com>2021-10-15 18:21:35 +0300
commit165d47f4bb3d79f405691a7cfb6ece55b33cd81c (patch)
tree49bf15f3f389c08c1edfdaa44dda32c6b8501da9 /archinstall
parentba725517fd290a60cd4e1ea570dbbf94a47ede05 (diff)
Fix use_mirrors
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/mirrors.py11
1 files changed, 7 insertions, 4 deletions
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')