3 "$@" git '' git://git.xonotic.org/xonotic/ ''
4 "$@" http '' http://git.xonotic.org/xonotic/ ''
5 "$@" ssh '' ssh://xonotic@git.xonotic.org/ ''
7 "$@" ssh push ssh://xonotic@push.git.xonotic.org/ ''
9 "$@" git de git://de.git.xonotic.org/xonotic/ ''
10 "$@" http de http://de.git.xonotic.org/xonotic/ ''
12 "$@" git nl git://nl.git.xonotic.org/xonotic/ '*3/2'
13 "$@" http nl http://nl.git.xonotic.org/xonotic/ '*3/2'
15 "$@" git us git://us.git.xonotic.org/xonotic/ ''
16 "$@" http us http://us.git.xonotic.org/xonotic/ ''
21 "$@" . xonotic.git master ""
22 "$@" data/xonotic-data.pk3dir xonotic-data.pk3dir.git master ""
23 "$@" data/xonotic-music.pk3dir xonotic-music.pk3dir.git master ""
24 "$@" data/xonotic-nexcompat.pk3dir xonotic-nexcompat.pk3dir.git master "no"
25 "$@" darkplaces darkplaces.git div0-stable "svn"
26 "$@" netradiant netradiant.git master ""
27 "$@" div0-gittools div0-gittools.git master "no"
28 "$@" d0_blind_id d0_blind_id.git master ""
29 "$@" data/xonotic-maps.pk3dir xonotic-maps.pk3dir.git master ""
30 "$@" mediasource mediasource.git master "no"
31 "$@" fteqcc fteqcc.git xonotic-stable "noautocrlf"
36 if ! { time -p true; } >/dev/null 2>&1; then
40 # first result is to be ignored, but we use it to check status
41 git ls-remote "$1" refs/heads/master >/dev/null 2>&1 || return 1
42 # now actually time it
45 { time -p git ls-remote "$1" refs/heads/master; } 2>&1 >/dev/null | head -n 1 | cut -d ' ' -f 2 | tr -d . | sed 's,^0*,,' | grep . || echo 0
46 # unit: clock ticks (depends on what "time" returns
57 bestmirror_firstrepo()
59 if [ -z "$testrepo" ]; then
63 allrepos bestmirror_firstrepo
66 if [ x"$oldurl" = x"$3" ]; then
71 allmirrors bestmirror_findold
76 bestmirror_benchmark()
79 # empty location is not allowed
82 if [ x"$1" != x"$newprotocol" ]; then
85 # only working mirrors
86 if ! thistime=`mirrorspeed "$3$testrepo"`; then
89 thistime=$(($thistime $4))
90 # anything is better than nothing
91 if [ -z "$besttime" ]; then
98 # prefer location match
99 if [ x"$2" = x"$newlocation" ]; then
100 if [ x"$bestlocation" != x"$newlocation" ]; then
108 if [ x"$bestlocation" = x"$newlocation" ]; then
112 # if we get here, we must compare mirror speed as we have more than one match
113 if [ $thistime -gt $besttime ]; then
115 elif [ $thistime -lt $besttime ]; then
121 # both location and time match. Random decision.
122 bestcount=$(($bestcount + 1))
123 if [ $((($RANDOM + 0) % $bestcount)) -eq 0 ]; then
127 allmirrors bestmirror_benchmark