diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/libs/lib-ui-interactive.sh | 31 | ||||
-rw-r--r-- | src/core/procedures/interactive | 43 |
2 files changed, 29 insertions, 45 deletions
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 4412af2..c15c3a9 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -65,10 +65,7 @@ prefill_configs () { interactive_configure_system() { - if [ -z "$EDITOR" ] - then - interactive_get_editor || return 1 - fi + seteditor || return 1 FILE="" prefill_configs @@ -1150,12 +1147,9 @@ interactive_grub_menulst () { generate_grub_menulst helptext= grep -q '^/dev/mapper' $TMP_FSTAB && helptext=" /dev/mapper/ users: Pay attention to the kernel line!" - notify "Before installing GRUB, you must review the configuration file. You will now be put into the editor. After you save your changes and exit the editor, you can install GRUB.$helptext" - if [ -z "$EDITOR" ] - then - interactive_get_editor || return 1 - fi - $EDITOR $grubmenu + notify "Before installing GRUB, you must review the configuration file. You will now be put into the editor. After you save your changes and exit the editor, you can install GRUB.$helptext" + seteditor || return 1 + $EDITOR $grubmenu } interactive_grub_install () { @@ -1261,23 +1255,6 @@ interactive_select_mirror() { echo "Using mirror: $var_SYNC_URL" >$LOG } -# geteditor(). -# prompts the user to choose an editor -# sets EDITOR global variable -# -interactive_get_editor() { - unset EDITOR_OPTS - declare -A editors=(["nano"]="nano (easier)" ["joe"]="joe (bit more powerful)" ["vi"]="vi (advanced)") - for editor in ${!editors[@]} - do - which $editor &>/dev/null && EDITOR_OPTS+=($editor "${editors[$editor]}") - done - ask_option nano "Text editor selection" "Select a Text Editor to Use" required "${EDITOR_OPTS[@]}" || return 1 - EDITOR=nano - check_is_in "$ANSWER_OPTION" "${!editors[@]}" && EDITOR=$ANSWER_OPTION -} - - select_source_extras_menu () { while true; do diff --git a/src/core/procedures/interactive b/src/core/procedures/interactive index 0223763..d638e1c 100644 --- a/src/core/procedures/interactive +++ b/src/core/procedures/interactive @@ -4,7 +4,6 @@ depend_procedure core base # esp for auto_{network,locale,fstab}, intro and set_ # This is a port of the original /arch/setup script. It doesn't use aif phases but uses it's own menu-based flow (phase) control -EDITOR= BLOCK_ROLLBACK_USELESS=1 # clock @@ -16,6 +15,7 @@ TIMEZONE= DEFAULTFS="/boot:32:ext2:+ swap:256:swap /:7500:ext3 /home:*:ext3" worker_select_source_title='Select Source' +worker_set_editor_title='Set Editor' worker_runtime_network_title='Setup Network' worker_select_mirror_title='Choose Mirror' worker_set_clock_title='Set clock' @@ -51,40 +51,43 @@ mainmenu() ask_option $default "MAIN MENU" '' required \ "1" "$worker_select_source_title" \ - "2" "$worker_set_clock_title" \ - "3" "$worker_prepare_disks_title" \ - "4" "$worker_package_list_title" \ - "5" "$worker_install_packages_title" \ - "6" "$worker_configure_system_title" \ - "7" "$worker_install_bootloader_title" \ - "8" "Exit Install" + "2" "$worker_set_editor_title" \ + "3" "$worker_set_clock_title" \ + "4" "$worker_prepare_disks_title" \ + "5" "$worker_package_list_title" \ + "6" "$worker_install_packages_title" \ + "7" "$worker_configure_system_title" \ + "8" "$worker_install_bootloader_title" \ + "9" "Exit Install" case $ANSWER_OPTION in "1") execute worker select_source; local ret=$?; [ $ret -eq 0 -a "$var_PKG_SOURCE_TYPE" = net ] && execute worker select_source_extras_menu [ $ret -eq 0 ] && execute worker runtime_packages && NEXTITEM=2 ;; - "2") - execute worker set_clock && NEXTITEM=3 ;; + "2") + execute worker set_editor && NEXTITEM=3 ;; "3") - execute worker prepare_disks && NEXTITEM=4 ;; + execute worker set_clock && NEXTITEM=4 ;; "4") - check_depend worker prepare_disks && \ - check_depend worker select_source && execute worker package_list && NEXTITEM=5 ;; + execute worker prepare_disks && NEXTITEM=5 ;; "5") + check_depend worker prepare_disks && \ + check_depend worker select_source && execute worker package_list && NEXTITEM=6 ;; + "6") check_depend worker package_list && \ check_depend worker select_source && execute worker install_packages && { execute worker auto_fstab ; \ execute worker auto_locale ; \ execute worker auto_keymap_font; - true ; } && NEXTITEM=6 ;; - "6") + true ; } && NEXTITEM=7 ;; + "7") check_depend worker install_packages && execute worker auto_network && \ execute worker configure_system && { execute worker mkinitcpio ; \ execute worker locales ; execute worker initialtime ; - true ; } && NEXTITEM=7 ;; - "7") - check_depend worker configure_system && execute worker install_bootloader && NEXTITEM=8 ;; + true ; } && NEXTITEM=8 ;; "8") + check_depend worker configure_system && execute worker install_bootloader && NEXTITEM=9 ;; + "9") notify "If the install finished successfully, you can now type 'reboot' to restart the system." && stop_installer ;; *) execute worker abort_installer;; @@ -112,6 +115,10 @@ worker_select_source () return 1 } +worker_set_editor () +{ + seteditor force +} worker_intro () { |