Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-10-27 11:52:44 +0200
committerGitHub <noreply@github.com>2021-10-27 11:52:44 +0200
commitae0d700c7e0577cd2a65b69541bbf053c3985136 (patch)
tree58dbdc5497564d2e6d2a851f05d18cb57bf7b8f5
parent72849083e611486d4a3d141b30c7ad7f2b986cec (diff)
parenta822b8edae2c80edc86e786e27d876b705b5c985 (diff)
Merge pull request #668 from olekthunder/use_mirrors_fix
Fix use_mirrors
-rw-r--r--archinstall/lib/mirrors.py12
1 files changed, 7 insertions, 5 deletions
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):