summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2010-12-18 12:24:37 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2010-12-18 12:24:37 +0100
commite03fee6cf554c1408955baa8ebde8ebf1e13c53e (patch)
treeff2dd83b34387b40dca0dd3b9e575e3bc30b239d /src
parent2b576c8f64f416e73a4fcc363fb05cdbf3764717 (diff)
simplify PV selection a tiny bit by using array directly
Diffstat (limited to 'src')
-rw-r--r--src/core/libs/lib-ui-interactive.sh15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh
index 843fd09..2ee3a2c 100644
--- a/src/core/libs/lib-ui-interactive.sh
+++ b/src/core/libs/lib-ui-interactive.sh
@@ -468,22 +468,21 @@ interactive_filesystem ()
fs_params="$fs_params$pv"
fi
- list=
+ list=()
for pv in $fs_params
do
- list="$list $pv ^ ON"
+ list+=("$pv" ^ ON)
done
for pv in `grep '+ lvm-pv' $TMP_BLOCKDEVICES | awk '{print $1}' | sed 's/\+$//'` # find PV's to be added: their blockdevice ends on + and has lvm-pv as type #TODO: i'm not sure we check which pv's are taken already
do
- grep -q "$pv ^ ON" <<< "$list" || list="$list $pv - OFF"
+ grep -q "$pv ^ ON" <<< "${list[@]}" || list+=("$pv" - OFF)
done
- list2=($list)
- if [ ${#list2[*]} -lt 6 ] # less then 6 words in the list. eg only one option
+ if [ ${#list[*]} -lt 6 ] # less then 6 words in the list. eg only one option
then
- notify "Automatically picked PV ${list2[0]} to use for this VG. It's the only available lvm PV"
- fs_params=${list2[0]}
+ notify "Automatically picked PV ${list[0]} to use for this VG. It's the only available lvm PV"
+ fs_params=${list[0]}
else
- ask_checklist "Which lvm PV's must this volume group span?" 0 $list || return 1
+ ask_checklist "Which lvm PV's must this volume group span?" 0 "${list[@]}" || return 1
fs_params="${ANSWER_CHECKLIST[@]}"
fi
fi