Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Zinkevych <zso040399@gmail.com>2021-10-15 18:03:08 +0300
committerOleksandr Zinkevych <zso040399@gmail.com>2021-10-15 18:03:08 +0300
commit427492d7c9a386dbeb08561f163b9a68870f6e71 (patch)
tree05e34ed842871d225c1d18ec18ba0ea2fae70c56
parentba725517fd290a60cd4e1ea570dbbf94a47ede05 (diff)
Fix re_rank_mirrors
-rw-r--r--archinstall/lib/mirrors.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/archinstall/lib/mirrors.py b/archinstall/lib/mirrors.py
index 1b62a61b..2325282f 100644
--- a/archinstall/lib/mirrors.py
+++ b/archinstall/lib/mirrors.py
@@ -123,10 +123,17 @@ def use_mirrors(regions: dict, destination='/etc/pacman.d/mirrorlist'):
return True
-def re_rank_mirrors(top=10, *positionals, **kwargs):
- if SysCommand(f'/usr/bin/rankmirrors -n {top} /etc/pacman.d/mirrorlist > /etc/pacman.d/mirrorlist').exit_code == 0:
- return True
- return False
+def re_rank_mirrors(
+ top: int = 10,
+ src: str = '/etc/pacman.d/mirrorlist',
+ dst: str = '/etc/pacman.d/mirrorlist',
+) -> bool:
+ cmd = SysCommand(f"/usr/bin/rankmirrors -n {top} {src}")
+ if cmd.exit_code != 0:
+ return False
+ with open(dst, 'w') as f:
+ f.write(str(cmd))
+ return True
def list_mirrors(sort_order=["https", "http"]):