fix: overwrite pacman mirrorlist directly

This commit is contained in:
Rudra B.S. 2023-11-20 20:32:14 +05:30
parent 5d28f203cf
commit 952bcd738c

View file

@ -213,8 +213,6 @@ def update_system():
print(blend_release)
exec_chroot('cp', '/.new_rootfs/etc/pacman.d/mirrorlist', '/.new_rootfs/etc/pacman.d/mirrorlist.bkp')
with open('/.new_rootfs/etc/pacman.d/mirrorlist', 'w') as pacman_mirrorlist_conf:
pacman_mirrorlist_conf.write('Server = https://cloudflaremirrors.com/archlinux/$repo/os/$arch\n')
@ -236,9 +234,7 @@ def update_system():
if return_val == 0:
break
exec_chroot('mv', '/.new_rootfs/etc/pacman.d/mirrorlist.bkp', '/.new_rootfs/etc/pacman.d/mirrorlist')
exec_chroot('reflector', '--latest', '20', '--protocol', 'https', '--sort', 'rate', '--save', '/etc/pacman.d/mirrorlist')
exec_chroot('reflector', '--latest', '5', '--protocol', 'https', '--sort', 'rate', '--save', '/etc/pacman.d/mirrorlist')
#exec_chroot('sed', 's/#//g', '-i', '/etc/pacman.d/mirrorlist')
#exec_chroot('bash', '-c', 'grep "^Server =" /etc/pacman.d/mirrorlist > /etc/pacman.d/mirrorlist.tmp; mv /etc/pacman.d/mirrorlist.tmp /etc/pacman.d/mirrorlist')