mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
add error function
This commit is contained in:
parent
5e120cd163
commit
e280f5ec5a
1 changed files with 13 additions and 5 deletions
|
@ -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!
|
||||
|
|
Loading…
Reference in a new issue