From c113ed8e15966559b98e1027b41bf065375abe99 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 7 Apr 2015 07:04:20 +0000 Subject: setup-apkrepos: add -f for just-add-fastest mirror fixes #4017 --- setup-apkrepos.in | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/setup-apkrepos.in b/setup-apkrepos.in index e29572e..8bbb811 100644 --- a/setup-apkrepos.in +++ b/setup-apkrepos.in @@ -137,11 +137,12 @@ edit_repositories() { usage() { cat <<__EOF__ -usage: setup-apkrepos [-hr] [REPO...] +usage: setup-apkrepos [-fhr] [REPO...] Setup apk repositories options: + -f Detect and add fastest mirror -h Show this help -r Add a random mirror and do not prompt __EOF__ @@ -149,8 +150,9 @@ __EOF__ } -while getopts "hr" opt; do +while getopts "fhr" opt; do case $opt in + f) JUSTADDFASTEST=1;; h) usage;; r) JUSTADDRANDOM=1;; esac @@ -193,6 +195,11 @@ if [ -n "$JUSTADDRANDOM" ]; then add_random_mirror && changed=true fi +if [ -n "$JUSTADDFASTEST" ]; then + show_mirror_list > /dev/null + add_fastest_mirror && changed=true +fi + while ! $changed; do show_mirror_list prompt_setup_method $default_answer -- cgit v1.2.3