summaryrefslogtreecommitdiff
path: root/src/core/libs/lib-ui-interactive.sh
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2010-12-12 20:33:15 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2010-12-12 20:34:04 +0100
commitd487df8c9ecf58af3ab46e7f2b898a9b4f6ba097 (patch)
tree3d6cee09d663fd4350d84bd05a8d57d8b4197e81 /src/core/libs/lib-ui-interactive.sh
parent33d5d154c66850c118f1074f215f212fa89ee791 (diff)
make BLOCKFRIENDLY prettier
use arrays, so we can allow whitespace in the labels
Diffstat (limited to 'src/core/libs/lib-ui-interactive.sh')
-rw-r--r--src/core/libs/lib-ui-interactive.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh
index 5b622d0..1b5be6e 100644
--- a/src/core/libs/lib-ui-interactive.sh
+++ b/src/core/libs/lib-ui-interactive.sh
@@ -246,15 +246,15 @@ interactive_prepare_disks ()
interactive_autoprepare()
{
listblockfriendly
- if [ $(echo $BLOCKFRIENDLY | wc -w) -gt 1 ]
+ if [ ${#BLOCKFRIENDLY[@]} -gt 2 ]
then
- ask_option no 'Harddrive selection' "Select the hard drive to use" required $BLOCKFRIENDLY || return 1
+ ask_option no 'Harddrive selection' "Select the hard drive to use" required "${BLOCKFRIENDLY[@]}" || return 1
DISC=$ANSWER_OPTION
- elif [ -z "$BLOCKFRIENDLY" ]; then
+ elif [ ${#BLOCKFRIENDLY[@]} -eq 0 ]; then
ask_string "Could not find disk. Please enter path of devicefile manually" "" || return 1
DISC=${ANSWER_STRING// /} # TODO : some checks if $DISC is really a blockdevice is probably a good idea
else
- DISC=$(echo $BLOCKFRIENDLY | cut -d ' ' -f 1)
+ DISC=${BLOCKFRIENDLY[0]}
fi
get_blockdevice_size $DISC MiB
@@ -330,11 +330,11 @@ interactive_partition() {
# Select disk to partition
listblockfriendly
- DISCS="$BLOCKFRIENDLY OTHER OTHER DONE DONE"
+ DISCS=("${BLOCKFRIENDLY[@]}" OTHER OTHER DONE DONE)
DISC=
while true; do
# Prompt the user with a list of known disks
- ask_option no 'Disc selection' "$question_text (select DONE when finished)" required $DISCS || return 1
+ ask_option no 'Disc selection' "$question_text (select DONE when finished)" required "${DISCS[@]}" || return 1
DISC=$ANSWER_OPTION
if [ "$DISC" = "OTHER" ]; then
ask_string "Enter the full path to the device you wish to partition" "/dev/sda" || return 1