summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2008-11-11 20:49:12 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2008-11-11 20:49:12 +0100
commitd2270c1cb1f117c23a6c669469145f2352e30d0d (patch)
treead754ac6515dc35e69eaa0ba19410688f956267c
parent21f4084ace35f45c20154f657c3ce79c962abe91 (diff)
fix for ask_yesno height (maybe) + todo updates + debugging added to several ui functions + bootloader worker refactoring
-rw-r--r--TODO8
-rw-r--r--src/core/libs/lib-ui.sh13
-rw-r--r--src/core/procedures/interactive23
3 files changed, 31 insertions, 13 deletions
diff --git a/TODO b/TODO
index 584f6fe..c39a84d 100644
--- a/TODO
+++ b/TODO
@@ -18,13 +18,16 @@ General:
* by now we should be able to shift dia/cli in all procedures and everything
should keep working fine
* sometimes you can't see the whole question in ask_yesno (eg after manually partitioning/setting mountpoints)
- -> maybe just increase the panel for all dia ask_yesno's
+ -> maybe just increase the panel for all dia ask_yesno's -> fixed now i
+ think with automatic height calculation
Specifically:
* core/interactive bug: boot space 15 -> too large should be too small
* core/interactive bug: swap space 0 -> invalid?
* core/interactive: keymap setting from installer does not go in $target/etc/rc.conf
* core/interactive: try out different installation methods
+* core/interactive: manual filesystem mountpoints sometimes ok, sometimes filesystem creation is "very fast" and the filesystems are
+not mounted under /mnt
* core/base: implement as specified in README
* core/quickinst: figure out what needs to be done and do it.
* dieter/automatic: wait for yaourt --config fix
@@ -44,6 +47,9 @@ PRODUCTION PHASE: be the primary installer. deprecate /arch/setup and /arch/qui
* core/interactive: more control over filesystems (lvm, dm_crypt, choose each FS and each size yourself)
when doing lvm install. copy /etc/lvm/backup to /etc on target (or maybe
it can be regenerated with a command, i should look that up)
+* core/interactive: do pacman -Sy in the background during early phases, to
+ lessen the wait period before selecting packages
+* write bash completion thing for fifa modules/procedures
SOMEDAY/MAYBE/RANDOM THOUGHTS:
diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh
index 927ba96..340cdb5 100644
--- a/src/core/libs/lib-ui.sh
+++ b/src/core/libs/lib-ui.sh
@@ -190,6 +190,7 @@ _dia_ask_option ()
ret=$?
ANSWER_OPTION=`cat $ANSWER`
echo $ANSWER_OPTION
+ debug "User choose $ANSWER_OPTION"
return $ret
}
@@ -215,6 +216,7 @@ _cli_ask_option ()
[ -z "$DEFAULT" ] && echo -n " > "
read ANSWER_OPTION
[ -z "$ANSWER_OPTION" -a -n "$DEFAULT" ] && ANSWER_OPTION="$DEFAULT"
+ debug "User choose $ANSWER_OPTION"
echo "$ANSWER_OPTION"
}
@@ -242,7 +244,12 @@ _dia_follow_progress ()
_dia_ask_yesno ()
{
- dialog --yesno "$1" 10 55 # returns 0 for yes, 1 for no
+ height=$((`echo -e "$1" | wc -l` +7))
+ dialog --yesno "$1" $height 55 # returns 0 for yes, 1 for no
+ ret=$?
+ [ $ret -eq 0 ] && debug "User picked YES"
+ [ $ret -gt 0 ] && debug "User picked NO"
+ return $ret
}
@@ -272,8 +279,10 @@ _cli_ask_yesno ()
answer=`tr '[:upper:]' '[:lower:]' <<< $answer`
if [ "$answer" = y -o "$answer" = yes ]
then
+ debug "User picked YES"
return 0
else
+ debug "User picked NO"
return 1
fi
}
@@ -284,6 +293,7 @@ _cli_ask_string ()
echo -n "$@: "
read answ
echo "$answ"
+ debug "User entered: $answ"
[ -z "$answ" ] && return 1
return 0
}
@@ -308,6 +318,7 @@ _cli_ask_number ()
fi
done
echo "$answ"
+ debug "user entered: $answ"
[ -z "$answ" ] && return 1
return 0
}
diff --git a/src/core/procedures/interactive b/src/core/procedures/interactive
index 721cf7a..93aade4 100644
--- a/src/core/procedures/interactive
+++ b/src/core/procedures/interactive
@@ -38,7 +38,7 @@ start_process ()
S_INSTALL=0 # package installation
S_CONFIG=0 # configuration editing
S_GRUB=0 # TODO: kill this - if using grub
- S_BOOT="" # bootloader installed (set to loader name instead of 1)
+ S_BOOT="" # bootloader installed
var_UI_TYPE=dia
@@ -73,7 +73,7 @@ mainmenu()
"5" "Configure System" \
"6" "Install Bootloader" \
"7" "Exit Install"
- NEXTITEM="$ANSWER_OPTION"
+ NEXTITEM="$ANSWER_OPTION" #TODO: set next item always current+1 after succesfull finish of each phase/worker, if relevant
case $ANSWER_OPTION in
"0")
execute worker select_source; ret=$?
@@ -100,10 +100,7 @@ mainmenu()
"5")
execute worker configure_system && S_CONFIG=1 && { execute worker mkinitcpio; execute worker locales; } ;;
"6")
- ask_option no "Which bootloader would you like to use? Grub is the Arch default." \
- "GRUB" "Use the GRUB bootloader (default)" \
- "None" "\Zb\Z1Warning\Z0\ZB: you must install your own bootloader!"
- execute worker install_bootloader "$ANSWER_OPTION";;
+ execute worker install_bootloader && S_BOOT=1 ;;
"7")
notify "If the install finished successfully, you can now type 'reboot' to restart the system." && stop_installer ;;
*)
@@ -246,15 +243,19 @@ worker_select_mirror ()
interactive_select_mirror
}
-# $1 which one
+
worker_install_bootloader ()
{
- bl=`tr '[:upper:]' '[:lower:]' <<< "$1"`
- log "User picked bootloader $bl ..."
- [ "$bl" = grub ] && interactive_install_grub && S_BOOT=grub
- [ "$bl" != grub ] && S_BOOT="$bl"
+ ask_option Grub "Which bootloader would you like to use? Grub is the Arch default." \
+ "Grub" "Use the GRUB bootloader (default)" \
+ "None" "\Zb\Z1Warning\Z0\ZB: you must install your own bootloader!"
+
+ bl=`tr '[:upper:]' '[:lower:]' <<< "$ANSWER_OPTION"`
+ [ "$bl" != grub ] && return 0
+ interactive_install_grub
}
+
worker_auto_network ()
{
[ $S_NET -eq 0 ] && return 1