Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds+github@gmail.com>2019-11-19 01:14:08 +0000
committerAnton Hvornum <anton.feeds+github@gmail.com>2019-11-19 01:14:08 +0000
commitb3e9505fab33af0e2420c98cea9b0b5dc9949677 (patch)
tree8fca3fb0b4588249acb853b3593d0a4c2955364e
parent6b570b62c2556932451f404f62cd31068dd1a3b0 (diff)
Cleaned up function calls a bit
-rw-r--r--archinstall.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/archinstall.py b/archinstall.py
index 83193aa7..2b3cc302 100644
--- a/archinstall.py
+++ b/archinstall.py
@@ -892,20 +892,22 @@ def mount_mountpoints(drive, bootpartition, mountpoint='/mnt/boot', *positionals
return True
def re_rank_mirrors(top=10, *positionals, **kwargs):
- if sys_command(('/usr/bin/rankmirrors -n {top} /root/mirrorlist > /etc/pacman.d/mirrorlist')).exit_code == 0:
+ if sys_command(('/usr/bin/rankmirrors -n {top} /etc/pacman.d/mirrorlist > /etc/pacman.d/mirrorlist')).exit_code == 0:
return True
return False
-def filter_mirrors_by_country(countries, top=10, *positionals, **kwargs):
+def filter_mirrors_by_country_list(countries, top=None, *positionals, **kwargs):
## TODO: replace wget with urllib.request (no point in calling syscommand)
country_list = []
for country in countries.split(','):
country_list.append(f'country={country}')
o = b''.join(sys_command((f"/usr/bin/wget 'https://www.archlinux.org/mirrorlist/?{'&'.join(country_list)}&protocol=https&ip_version=4&ip_version=6&use_mirror_status=on' -O /root/mirrorlist")))
o = b''.join(sys_command(("/usr/bin/sed -i 's/#Server/Server/' /root/mirrorlist")))
+ o = b''.join(sys_command(("/usr/bin/mv /root/mirrorlist /etc/pacman.d/")))
- if not re_rank_mirrors(top, *positionals, **kwargs) or not os.path.isfile('/etc/pacman.d/mirrorlist'):
- o = b''.join(sys_command(("/usr/bin/mv /root/mirrorlist /etc/pacman.d/")))
+ if top:
+ re_rank_mirrors(top, *positionals, **kwargs) or not os.path.isfile('/etc/pacman.d/mirrorlist')
+
return True
def strap_in_base(*positionals, **kwargs):
@@ -1167,7 +1169,7 @@ if __name__ == '__main__':
if 'mirrors' in args and args['mirrors'] and 'country' in args and get_default_gateway_linux():
print('[N] Reordering mirrors.')
- filter_mirrors_by_country(args['country'])
+ filter_mirrors_by_country_list([args['country']])
pre_conf = {}
if 'pre' in instructions: