From 627a29ba5161354d8cf24a9f0d09e3b5823d5313 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 2 Mar 2011 13:07:15 +0000 Subject: setup-apkrepos: make show mirror list a separate function --- setup-apkrepos.in | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/setup-apkrepos.in b/setup-apkrepos.in index 6a7a59d..22f6387 100755 --- a/setup-apkrepos.in +++ b/setup-apkrepos.in @@ -92,6 +92,15 @@ get_fastest_mirror() { echo "using $(get_hostname_from_url $mirror)" } +show_mirror_list() { + local mirror i=1 + echo "" + for mirror in $MIRRORS; do + echo "$i) $(get_hostname_from_url $mirror)" + i=$(($i + 1)) + done +} + prompt_mirror_list() { local i local mirror_hostname @@ -99,13 +108,7 @@ prompt_mirror_list() { local mirror_count=$(count $MIRRORS) while true; do - echo "" - i=1 - for mirror in $MIRRORS; do - echo "$i) $(get_hostname_from_url $mirror)" - i=$(($i + 1)) - done - + show_mirror_list echo -en "\nPlease select a mirror from the above list: " read mirror_index case $mirror_index in -- cgit v1.2.3