summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/action/update.sh18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/action/update.sh b/src/action/update.sh
index 3d897bc..7cbfcf3 100644
--- a/src/action/update.sh
+++ b/src/action/update.sh
@@ -17,7 +17,7 @@
do_update()
{
- local dists=''
+ local dist_ids=''
local i=0
local dist=''
local mirror_url=''
@@ -32,20 +32,22 @@ do_update()
fi
# Select distributor.
- # TODO: Show names in menu labels.
- dists="$(board_get_dists)"
- if [ $(printf '%s' "${dists}" | wc -w | cut -d ' ' -f 1) -gt 1 ]; then
- i=$(show_menu 'Select a firmware distributor' ${dists})
+ dist_ids="$(board_get_dists)"
+ if [ $(printf '%s' "${dist_ids}" | wc -w | cut -d ' ' -f 1) -gt 1 ]; then
+ set --
+ for dist_id in ${dist_ids}; do
+ set -- "${@}" "$(dist_get_name "${dist_id}")"
+ done
+ i=$(show_menu 'Select a firmware distributor' "${@}")
i=$(($i + 1))
- dist="$(printf '%s ' ${dists} | cut -d ' ' -f ${i})"
+ dist="$(printf '%s ' ${dist_ids} | cut -d ' ' -f ${i})"
else
- dist="$(printf '%s' ${dists})"
+ dist="$(printf '%s' ${dist_ids})"
fi
select_dist "${dist}"
info 'Distributor: %s' "${dist}"
# Select mirror.
- # TODO: Handle show_menu() output.
set --
while :; do
if ! read -r mirror_url || ! read -r mirror_label; then