From: Rudolf Polzer Date: Sat, 20 Nov 2010 21:40:17 +0000 (+0100) Subject: fudge factors for mirrors: NL mirror gets a 50% malus in the mirror selection X-Git-Tag: xonotic-v0.1.0preview~39 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=72f8a00ef40fb291d64215799748e09f3ec5c93b;p=xonotic%2Fxonotic.git fudge factors for mirrors: NL mirror gets a 50% malus in the mirror selection --- diff --git a/all b/all index f584ede5..e6964054 100755 --- a/all +++ b/all @@ -368,15 +368,28 @@ bestmirror() bestin= bestt= - for in in "$@"; do + for mir in "$@"; do + case "$mir" in + *:*) + in=${mir%%:*} + op=${mir#*:} + ;; + *) + in=$mir + op= + ;; + esac m=$pre$in$suf if t=`mirrorspeed "$m"`; then - msg "$m -> $t ticks" if [ -n "$t" ]; then + t=$(($t$op)) # fudge factor + msg "$m -> $t ticks ($op)" if [ -z "$bestt" ] || [ "$t" -lt "$bestt" ]; then bestin=$in bestt=$t fi + else + msg "$m -> error" fi else msg "$m -> FAIL" @@ -516,7 +529,7 @@ case "$cmd" in newbase=`$ECHO "$base" | sed "s,://\(.*\.\)\?git.xonotic.org/,:// .git.xonotic.org/,"` case "$newbase" in *\ *) - if location=`bestmirror $newbase"xonotic.git" de nl us`; then + if location=`bestmirror $newbase"xonotic.git" de us nl:'*3/2'`; then : else location=current