X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=all;h=338967a7e998281f6e47c88f6823ba278dbb8b69;hp=26a302776e26e28588f4762ca315e83030ff93f2;hb=ca76086bfdfc713ecded00f8e4c7fa6d0cdc49a2;hpb=d76f3ba20d8487be18eea70e3c67669542fa41ac diff --git a/all b/all index 26a30277..338967a7 100755 --- a/all +++ b/all @@ -339,6 +339,39 @@ mkzip0() zip -0y "$@" } +mirrorspeed() +{ + # first result is to be ignored, but we use it to check status + git ls-remote "$1" refs/heads/master >/dev/null 2>&1 || return 1 + { 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*,,' + # unit: clock ticks (depends on what "time" returns +} + +bestmirror() +{ + pre=$1; shift + suf=$1; shift + + bestin= + bestt= + for in in "$@"; do + m=$pre$in$suf + if t=`mirrorspeed "$m"`; then + msg "$m -> $t ticks" + if [ -n "$t" ]; then + if [ -z "$bestt" ] || [ "$t" -lt "$bestt" ]; then + bestin=$in + bestt=$t + fi + fi + else + msg "$m -> FAIL" + fi + done + msg "Best mirror seems to be $pre$bestin$suf" + echo "$bestin" +} + case "$cmd" in fix_upstream_rebase) for d in $repos; do @@ -438,12 +471,14 @@ case "$cmd" in case "$2" in nl) ;; de) ;; + best) ;; default) ;; *) msg "Invalid location!" msg "Possible locations for the -l option:" msg " nl (Netherlands, run by merlijn)" msg " de (Germany, run by divVerent)" + msg " best (find automatically)" msg " default (currently nl)" exit 1 ;; @@ -471,6 +506,17 @@ case "$cmd" in ;; esac ;; + best) + base=`echo "$base" | sed "s,://\(.*\.\)\?git.xonotic.org/,:// .git.xonotic.org/,"` + case "$base" in + *\ *) + location=`bestmirror $base"xonotic.git" de nl` + ;; + *) + location= + ;; + esac + ;; esac if [ -n "$location" ]; then base=`echo "$base" | sed "s,://\(.*\.\)\?git.xonotic.org/,://$location.git.xonotic.org/,"` @@ -1138,7 +1184,7 @@ case "$cmd" in # apply crlf, or other cleanup filters (non-behavioural changes) git reset --hard find . -type f -exec touch {} \; - git commit -a --amend -c HEAD + git commit -a --amend -C HEAD || true # don't fail if nothing to commit echo "MERGING" case ",`repoflags "$d"`," in @@ -1221,8 +1267,21 @@ case "$cmd" in rmuntracked=true elif [ x"$X" = x"-D" ]; then killbranches=true + elif echo "$X" | grep '^-FFFF*UUUU*$' >/dev/null; then + msg '' + msg ' _____' + msg ' ,--'\''-\\P/`\\ FFFFFFF' + msg ' __/_ B/,-.\\ FFFFFFF' + msg ' / _\\ (// O\\\\ FFFFFF' + msg '| (O `) _\\._ _)\\ FFFUU' + msg '| |___/.^d0~~"\\ \\ UUUU' + msg '| |`~'\'' \\ | UUUU' + msg '| | __,C>|| UUUU' + msg '\\ /_ ,-/,-'\'' | UUUU' + msg ' \\\\_ \\_>~'\'' / UUUU-' + msg '' else - break + msg "Unknown arg: $X" fi found=true shift @@ -1545,7 +1604,7 @@ case "$cmd" in # music: reduce bitrate verbose export do_jpeg=true verbose export jpeg_qual_rgb=80 - verbose export jpeg_qual_a=99 + verbose export jpeg_qual_a=97 verbose export do_dds=false verbose export do_ogg=true verbose export ogg_qual=1