Commit 3f769dc9 authored by Natanael Copa's avatar Natanael Copa

setup-apkrepos: exclude faulty mirrors from detection

ref #4017
parent c113ed8e
......@@ -39,17 +39,20 @@ add_random_mirror() {
time_cmd() {
local start=$(cut -d ' ' -f1 /proc/uptime)
$@ >&2
local ret=$?
awk -v start=$start -v end=$(cut -d ' ' -f1 /proc/uptime) \
'BEGIN {print end - start; exit}'
return $ret
}
find_fastest_mirror() {
export http_proxy=
local url=
for url in $MIRRORS; do
echo $(time_cmd apk update --quiet $apk_root_opt \
local time=$(time_cmd apk update --quiet $apk_root_opt \
--repository $url/edge/main \
--repositories-file /dev/null) $url
--repositories-file /dev/null) || continue
echo "$time $url"
done | awk ' {
if (!current) {
current=$1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment