refactor(os): Retry pacman download on fail

This commit is contained in:
hygienic-books 2024-12-28 16:33:13 +01:00
parent eadbbea2fd
commit 08f33c33c7

View File

@ -429,12 +429,18 @@ function update_pacman_db () {
systemctl start reflector systemctl start reflector
# In an ISO and for the minimal number of packages we need we do not # In an ISO and for the minimal number of packages we need we do not
# care about partial upgrades # care about partial upgrades
pacman -Syyuu --noconfirm while ! pacman -Syyuu --needed --noconfirm --downloadonly; do
sleep 5
done
pacman -Syyuu --needed --noconfirm
} }
function install_pkgs () { function install_pkgs () {
#1.5 #1.5
printf -- '%s\n' 'Installing packages ...' printf -- '%s\n' 'Installing packages ...'
while ! pacman -S --needed --noconfirm --downloadonly "${@}"; do
sleep 5
done
pacman -S --needed --noconfirm "${@}" pacman -S --needed --noconfirm "${@}"
} }
@ -763,7 +769,7 @@ function install_archlinux () {
#1.12 #1.12
pacman_dl_parallel pacman_dl_parallel
pacman_dont_check_space pacman_dont_check_space
pacstrap /mnt \ while ! pacstrap /mnt \
base \ base \
base-devel \ base-devel \
linux \ linux \
@ -783,7 +789,9 @@ function install_archlinux () {
bluez-utils \ bluez-utils \
man-db \ man-db \
xdg-utils \ xdg-utils \
xdg-user-dirs xdg-user-dirs; do
sleep 5
done
} }
function gen_fstab () { function gen_fstab () {
@ -1295,6 +1303,9 @@ function install_os_in_chroot () {
rm -rf '/etc/pacman.d/gnupg' rm -rf '/etc/pacman.d/gnupg'
pacman-key --init pacman-key --init
pacman-key --populate archlinux pacman-key --populate archlinux
while ! pacman -S archlinux-keyring --noconfirm --downloadonly; do
sleep 5
done
pacman -S archlinux-keyring --noconfirm pacman -S archlinux-keyring --noconfirm
locale-gen locale-gen