From 2b576c8f64f416e73a4fcc363fb05cdbf3764717 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 18 Dec 2010 12:18:55 +0100 Subject: adapt ask_checklist calls for new libui-sh api since e549a38079530afc3913 --- src/core/libs/lib-ui-interactive.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index a77a873..843fd09 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -483,7 +483,7 @@ interactive_filesystem () notify "Automatically picked PV ${list2[0]} to use for this VG. It's the only available lvm PV" fs_params=${list2[0]} else - ask_checklist "Which lvm PV's must this volume group span?" $list || return 1 + ask_checklist "Which lvm PV's must this volume group span?" 0 $list || return 1 fs_params="${ANSWER_CHECKLIST[@]}" fi fi @@ -742,7 +742,7 @@ If any previous configuration you've done until now (like fancy filesystems) req grouplist+=(${i} - OFF) done - ask_checklist "Select Package groups\nDo not deselect base unless you know what you're doing!" "${grouplist[@]}" || return 1 + ask_checklist "Select Package groups\nDo not deselect base unless you know what you're doing!" 0 "${grouplist[@]}" || return 1 grouplist=("${ANSWER_CHECKLIST[@]}") # get sorted array of available packages, with their groups. TODO: we should use $repos here -- cgit v1.2.3 From e03fee6cf554c1408955baa8ebde8ebf1e13c53e Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 18 Dec 2010 12:24:37 +0100 Subject: simplify PV selection a tiny bit by using array directly --- src/core/libs/lib-ui-interactive.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src') 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 -- cgit v1.2.3