add error function

This commit is contained in:
Tobias Powalowski 2023-08-05 15:59:44 +02:00
parent 5e120cd163
commit e280f5ec5a

View file

@ -18,23 +18,30 @@ _run_pacman(){
echo -e "\nPackage Installation Complete." >>/tmp/pacman.log
fi
rm /.archboot) &
_progress_wait "0" "100" "Installing package:${_PACKAGES}..." "2"
_progress_wait "0" "99" "Installing package:\n${_PACKAGES}..." "2"
# pacman finished, display scrollable output
local _RESULT=''
if [[ $(cat /tmp/.pacman-retcode) -ne 0 ]]; then
_RESULT="Installation Failed (see errors below)"
_dialog --title "${_RESULT}" --exit-label "Continue" \
--textbox "/tmp/pacman.log" 18 70 || return 1
_progress "100" "Package installation failed." 6 75
sleep 2
else
_progress "100" "Package installation complete." 6 75
sleep 2
fi
rm /tmp/.pacman-retcode
# ensure the disk is synced
sync
_chroot_umount
}
_pacman_error() {
if [[ $(cat /tmp/.pacman-retcode) -ne 0 ]]; then
_RESULT="Installation Failed (see errors below)"
_dialog --title "${_RESULT}" --exit-label "Continue" \
--textbox "/tmp/pacman.log" 18 70 || return 1
fi
rm /tmp/.pacman-retcode
fi
_install_packages() {
_destdir_mounts || return 1
_PACKAGES=""
@ -47,6 +54,7 @@ _install_packages() {
_PACKAGES="${_PACKAGES// / }"
_dialog --title " Summary " --yesno "Next step will install the following packages for a minimal system:\n${_PACKAGES}\n\nYou can watch the progress on your ${_VC} console." 9 75 || return 1
_run_pacman | _dialog --title " Logging to ${_LOG} " --gauge "Installing package:\n${_PACKAGES}..." 8 75 0
_pacman_error
_NEXTITEM="3"
_chroot_mount
# automagic time!