index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton.feeds+github@gmail.com> | 2019-11-19 00:35:27 +0000 |
---|---|---|
committer | Anton Hvornum <anton.feeds+github@gmail.com> | 2019-11-19 00:35:27 +0000 |
commit | 7bdb2cfb923fdf13cd199ed0508fd3413976ce50 (patch) | |
tree | ea5b26d744c861356298f9980130590944f5b3c6 | |
parent | 673e607d4b3d8fab76f93e58bbcada6e9c9e7d50 (diff) |
-rw-r--r-- | archinstall.py | 8 |
diff --git a/archinstall.py b/archinstall.py index c9453bae..d94932a4 100644 --- a/archinstall.py +++ b/archinstall.py @@ -886,7 +886,9 @@ def mount_mountpoints(drive, bootpartition, mountpoint='/mnt/boot', *positionals return True def re_rank_mirrors(top=10, *positionals, **kwargs): - o = b''.join(sys_command(('/usr/bin/rankmirrors -n {top} /root/mirrorlist > /etc/pacman.d/mirrorlist'))) + if sys_command(('/usr/bin/rankmirrors -n {top} /root/mirrorlist > /etc/pacman.d/mirrorlist')).exit_code == 0: + return True + return False def filter_mirrors_by_country(countries, top=10, *positionals, **kwargs): ## TODO: replace wget with urllib.request (no point in calling syscommand) @@ -895,7 +897,9 @@ def filter_mirrors_by_country(countries, top=10, *positionals, **kwargs): 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"))) - re_rank_mirrors(top, *positionals, **kwargs) + + 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/"))) return True def strap_in_base(*positionals, **kwargs): |