summaryrefslogtreecommitdiff
path: root/src/core/libs/lib-ui-interactive.sh
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2009-07-21 10:56:55 +0200
committerDieter Plaetinck <dieter@plaetinck.be>2009-07-21 10:56:55 +0200
commitf03d31752e9e7df8c243d1b6cc0d4bd763f1a80f (patch)
tree2b67c896e771d130e79861b2803033d14437a52f /src/core/libs/lib-ui-interactive.sh
parentf8668b64c025dd2899d4b98f3a369b716dd30aa9 (diff)
more exit code / UI flow fixes inspired by Matthias Dienstbiers work
Diffstat (limited to 'src/core/libs/lib-ui-interactive.sh')
-rw-r--r--src/core/libs/lib-ui-interactive.sh18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh
index 712f1ac..089c326 100644
--- a/src/core/libs/lib-ui-interactive.sh
+++ b/src/core/libs/lib-ui-interactive.sh
@@ -19,7 +19,10 @@ check_depend ()
interactive_configure_system()
{
- [ "$EDITOR" ] || interactive_get_editor
+ if [ -z "$EDITOR" ]
+ then
+ interactive_get_editor || return 1
+ fi
FILE=""
## PREPROCESSING ##
@@ -169,7 +172,7 @@ interactive_prepare_disks ()
"2" "Partition Hard Drives" \
"3" "Configure block devices, filesystems and mountpoints" \
"4" "Rollback last filesystem changes$rollbackstr" \
- "5" "Return to Main Menu"
+ "5" "Return to Main Menu" || return 1
case $ANSWER_OPTION in
"1")
@@ -199,7 +202,7 @@ interactive_prepare_disks ()
fi
fi
;;
- *)
+ "5")
DONE=1 ;;
esac
done
@@ -815,7 +818,7 @@ interactive_runtime_network() {
interactive_install_bootloader () {
ask_option Grub "Choose bootloader" "Which bootloader would you like to use? Grub is the Arch default." required \
"Grub" "Use the GRUB bootloader (default)" \
- "None" "\Zb\Z1Warning\Z0\ZB: you must install your own bootloader!"
+ "None" "\Zb\Z1Warning\Z0\ZB: you must install your own bootloader!" || return 1
bl=`tr '[:upper:]' '[:lower:]' <<< "$ANSWER_OPTION"`
[ "$bl" != grub ] && return 0
@@ -882,7 +885,10 @@ EOF
# ...
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."
- [ -n "$EDITOR" ] || interactive_get_editor
+ if [ -z "$EDITOR" ]
+ then
+ interactive_get_editor || return 1
+ fi
$EDITOR $grubmenu
DEVS=$(finddisks 1 _)
@@ -1021,7 +1027,7 @@ interactive_get_editor() {
which nano &>/dev/null && EDITOR_OPTS+=("nano" "nano (easier)")
which joe &>/dev/null && EDITOR_OPTS+=("joe" "joe's editor")
which vi &>/dev/null && EDITOR_OPTS+=("vi" "vi (advanced)")
- ask_option no "Text editor selection" "Select a Text Editor to Use" required "${EDITOR_OPTS[@]}"
+ ask_option nano "Text editor selection" "Select a Text Editor to Use" required "${EDITOR_OPTS[@]}" || return 1
#TODO: this code could be a little bit cleaner.
case $ANSWER_OPTION in
"nano") EDITOR="nano" ;;