dynamic progressbar

This commit is contained in:
Tobias Powalowski 2023-08-31 14:29:14 +02:00
parent efbad5e9a5
commit f6de425a78

View file

@ -72,7 +72,7 @@ _enable_testing() {
fi fi
} }
_prepare_pacman() { _task_running_pacman_keyring() {
# pacman-key process itself # pacman-key process itself
while pgrep -x pacman-key &>"${_NO_LOG}"; do while pgrep -x pacman-key &>"${_NO_LOG}"; do
sleep 1 sleep 1
@ -82,18 +82,25 @@ _prepare_pacman() {
sleep 1 sleep 1
done done
[[ -e /etc/systemd/system/pacman-init.service ]] && systemctl stop pacman-init.service [[ -e /etc/systemd/system/pacman-init.service ]] && systemctl stop pacman-init.service
_progress "50" "Update Arch Linux keyring..." rm /.archboot
}
_task_pacman_keyring_install() {
_KEYRING="archlinux-keyring" _KEYRING="archlinux-keyring"
[[ "${_RUNNING_ARCH}" == "aarch64" ]] && _KEYRING="${_KEYRING} archlinuxarm-keyring" [[ "${_RUNNING_ARCH}" == "aarch64" ]] && _KEYRING="${_KEYRING} archlinuxarm-keyring"
#shellcheck disable=SC2086 #shellcheck disable=SC2086
if ! pacman -Sy --noconfirm --noprogressbar ${_KEYRING} &>"${_LOG}"; then pacman -Sy --noconfirm --noprogressbar ${_KEYRING} &>"${_LOG}"
_dialog --title " ERROR " --no-mouse --infobox "Keyring update failed! Check ${_LOG} for errors." 3 60 rm /.archboot
sleep 5 }
return 1 _prepare_pacman() {
else : > /.archboot
_task_running_pacman_keyring &
_progress_wait "0" "49" "Waiting for Arch Linux keyring initialization..." "0.01"
: > /.archboot
_task_pacman_keyring_install &
_progress_wait "50" "99" "Update Arch Linux keyring..." "0.01"
_progress "100" "Arch Linux keyring is ready." _progress "100" "Arch Linux keyring is ready."
sleep 2 sleep 2
fi
} }
_update_environment() { _update_environment() {