mediasource | | master |
darkplaces | | div0-stable | svn
fteqcc | git://github.com/Blub/qclib.git | master |
-div0-gittools | git://git.icculus.org/divverent/div0-gittools.git | master |
+div0-gittools | | master |
netradiant | | master |
+d0_blind_id | http://github.com/divVerent/d0_blind_id.git | master |
"
# todo: in darkplaces, change repobranch to div0-stable
cmd=$1
shift
+fix_upstream_rebase()
+{
+ if [ -z "$r_me" ] || [ -z "$r_other" ]; then
+ return
+ fi
+ r_base=`git merge-base "$r_me" "$r_other"`
+
+ # no merge-base? upstream did filter-branch
+ if [ -n "$r_base" ]; then
+ # otherwise, check if the two histories are "similar"
+ r_l_me=`git log --pretty="format:%s" "$r_other".."$r_me" | grep -v "^Merge" | sort -u`
+ r_l_other=`git log --pretty="format:%s" "$r_me".."$r_other" | grep -v "^Merge" | sort -u`
+
+ # heuristics: upstream rebase/filter-branch if more than 50% of the commits of one of the sides are in the other too
+ r_lc_me=`echo "$r_l_me" | wc -l`
+ r_lc_other=`echo "$r_l_other" | wc -l`
+ r_lc_together=`{ echo "$r_l_me"; echo "$r_l_other"; } | sort -u | wc -l`
+ r_lc_same=$(($r_lc_me + $r_lc_other - $r_lc_together))
+
+ if [ $(( $r_lc_same * 2 )) -gt $(( $r_lc_me )) ] || [ $(( $r_lc_same * 2 )) -gt $(( $r_lc_other )) ]; then
+ if yesno "Probable upstream rebase detected, automatically fix?" 'git log --oneline --graph --date-order --left-right "$r_other"..."$r_me"'; then
+ git reset --hard "$r_me"
+ git pull --rebase
+ return 1
+ fi
+ fi
+ fi
+
+ return 0
+}
+
+fix_upstream_rebase_mergeok()
+{
+ r_me=`git rev-parse --revs-only HEAD^1 2>/dev/null || true`
+ r_other=`git rev-parse --revs-only HEAD^2 2>/dev/null || true`
+ fix_upstream_rebase
+}
+
+fix_upstream_rebase_mergefail()
+{
+ r_me=`git rev-parse --revs-only HEAD 2>/dev/null || true`
+ r_other=`git rev-parse --revs-only MERGE_HEAD 2>/dev/null || true`
+ fix_upstream_rebase
+}
+
case "$cmd" in
+ fix_upstream_rebase)
+ for d in $repos; do
+ enter "$d0/$d" verbose
+ verbose fix_upstream_rebase_mergefail && verbose fix_upstream_rebase_mergeok
+ done
+ ;;
update|pull)
allow_pull=true
if [ x"$1" = x"-N" ]; then
r=${r#refs/heads/}
if git config branch.$r.remote >/dev/null 2>&1; then
if ! verbose git pull; then
+ fix_upstream_rebase_mergefail || true
check_mergeconflict "$d"
echo "Pulling failed. Press ENTER to continue, or Ctrl-C to abort."
read -r DUMMY
+ else
+ fix_upstream_rebase_mergeok || true
fi
fi
fi
case "$1" in
-c)
+ cleand0=true
cleandp=true
cleanqcc=true
cleanqc=true
shift
;;
-n)
+ cleand0=false
cleandp=false
cleanqcc=false
cleanqc=false
shift
;;
*)
+ cleand0=false
cleandp=false
cleanqcc=false
cleanqc=true # version info
fi
fi
+ enter "$d0/d0_blind_id" verbose
+ if ! [ -f Makefile ]; then
+ verbose sh autogen.sh
+ verbose ./configure
+ fi
+ if $cleand0; then
+ verbose make $MAKEFLAGS clean
+ fi
+ verbose make $MAKEFLAGS
+
enter "$d0/fteqcc" verbose
if $cleanqcc; then
verbose make $MAKEFLAGS clean
run)
if [ -n "$WE_HATE_OUR_USERS" ]; then
client=
- export PATH="$d0/misc/buildfiles/win64:$d0/misc/buildfiles/win32:$PATH"
+ export PATH="$d0/misc/buildfiles/win64:$d0/misc/buildfiles/win32:$d0/d0_blind_id/.libs:$PATH"
elif [ x"`uname`" = x"Darwin" ]; then
- export DYLD_LIBRARY_PATH="$d0/misc/buildfiles/osx/Xonotic-SDL.app/Contents/MacOS"
+ export DYLD_LIBRARY_PATH="$d0/misc/buildfiles/osx/Xonotic-SDL.app/Contents/MacOS:$d0/d0_blind_id/.libs"
export DYLD_FRAMEWORK_PATH="$d0/misc/buildfiles/osx/Xonotic-SDL.app/Contents/Frameworks"
client=-sdl
else
+ export LD_LIBRARY_PATH="$d0/d0_blind_id/.libs"
client=-sdl
fi
case "$1" in