From 8b1fd87d3c942f00c1d62b687739e247224225ee Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Wed, 29 Dec 2010 18:47:48 +0100 Subject: Show report at end of install in interactive procedure * port show_report to interactive procedure * use msg_report worker as method to exit the installer (this is more in line with the other procedures) --- doc/official_installation_guide_en | 6 ++++-- src/core/procedures/interactive | 29 +++++++++++++++++++++++++---- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/doc/official_installation_guide_en b/doc/official_installation_guide_en index b2200ef..770d223 100644 --- a/doc/official_installation_guide_en +++ b/doc/official_installation_guide_en @@ -787,8 +787,10 @@ number suffix. #### Exit Install -Exit the Installer, remove the media you used for the installation, type -reboot at the command line and cross your fingers! +You will be shown a summary of the installation, listing the steps and whether +they executed successfully or not. +If all went well, exit the installer, type reboot at the command line, remove +your installation media and cross your fingers! ### Automatic Installation Procedure diff --git a/src/core/procedures/interactive b/src/core/procedures/interactive index ebca22f..f3e3361 100644 --- a/src/core/procedures/interactive +++ b/src/core/procedures/interactive @@ -24,6 +24,9 @@ workertitles['package_list']='Select packages' workertitles['install_packages']='Install packages' workertitles['configure_system']='Configure system' workertitles['install_bootloader']='Install bootloader' +workertitles['msg_report']='Exit Install' + +menu_workers=(select_source set_editor set_clock prepare_disks package_list install_packages configure_system install_bootloader msg_report) start_process () { @@ -44,7 +47,6 @@ start_process () mainmenu() { - menu_workers=(select_source set_editor set_clock prepare_disks package_list install_packages configure_system install_bootloader) menu=() for i in ${!menu_workers[@]} do @@ -53,8 +55,6 @@ mainmenu() title=${workertitles[$worker]} menu+=($i "$title") done - let i+=1 - menu+=($i "Exit Install") ask_option $default "MAIN MENU" '' required "${menu[@]}" case $ANSWER_OPTION in @@ -69,7 +69,7 @@ mainmenu() check_depend worker select_source && execute worker install_packages && default=7 ;; "7") check_depend worker install_packages && execute worker configure_system && default=8 ;; "8") check_depend worker configure_system && execute worker install_bootloader && default=9 ;; - "9") notify "If the install finished successfully, you can now type 'reboot' to restart the system." && stop_installer ;; + "9") execute worker msg_report ;; *) execute worker abort_installer;; esac } @@ -181,6 +181,27 @@ worker_auto_network () return 0 } +# override show_report because this procedure does not use phases, but it's own menu +show_report () +{ + data="Execution Report:" + data="$data\n-----------------" + for w in ${menu_workers[@]} + do + [ "$w" = 'msg_report' ] && continue # this worker is the one calling show_report, we can't know our exitcode yet + title=${workertitles[$w]} + exit_var=exit_worker_$w + ret=${!exit_var} + [ "$ret" = "0" ] && data="$data\n > Worker $worker ($title): Sucess" + [ "$ret" = "0" ] || data="$data\n > Worker $worker ($title): Failed" + done + notify "$data\nIf the install finished successfully, you can type 'reboot' to restart the system." || return $? +} + +worker_msg_report () { + show_report && stop_installer +} + worker_abort_installer () { ret=0 -- cgit v1.2.3