aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-04-08 07:29:57 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-04-10 17:41:49 +0000
commit3f769dc941363dc1d4b4d3c898e6236003fddee8 (patch)
treeb2995e84c242a2982e06d56253103b6758884527
parentc113ed8e15966559b98e1027b41bf065375abe99 (diff)
downloadalpine-conf-3f769dc941363dc1d4b4d3c898e6236003fddee8.tar.bz2
alpine-conf-3f769dc941363dc1d4b4d3c898e6236003fddee8.tar.xz
setup-apkrepos: exclude faulty mirrors from detection
ref #4017
-rw-r--r--setup-apkrepos.in7
1 files changed, 5 insertions, 2 deletions
diff --git a/setup-apkrepos.in b/setup-apkrepos.in
index 8bbb811..5e0131a 100644
--- a/setup-apkrepos.in
+++ b/setup-apkrepos.in
@@ -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