]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - all
try helping windoze in finding the DLLs
[xonotic/xonotic.git] / all
diff --git a/all b/all
index 57d92453a1d1e89e0536081087b16d696a34bdef..a96e8880db2c514c63f6871c8db1d928413b1faa 100755 (executable)
--- a/all
+++ b/all
@@ -1,4 +1,5 @@
 #!/bin/sh
+# vim: filetype=zsh
 
 set -e
 
@@ -22,6 +23,7 @@ case "$0" in
                                # Windows hates users. So this script has to copy itself elsewhere first...
                                tname=
                                cp "$SELF" ../all.xonotic.sh
+                               export WE_HATE_OUR_USERS=1
                                exec ../all.xonotic.sh "$@"
                                ;;
                esac
@@ -117,6 +119,16 @@ repos_urls="
        netradiant
 "
 
+repos_urls=`
+       for X in $repos_urls; do 
+               d="${X%%@*}"
+               p="${d%dir}"
+               if [ x"$p" = x"$d" ] || [ -d "$d" ] || ! [ -f "$p" ]; then
+                       echo "$X"
+               fi
+       done
+`
+
 repos=`for X in $repos_urls; do echo "${X%%@*}"; done`
 
 if [ "$#" = 0 ]; then
@@ -153,14 +165,19 @@ case "$cmd" in
                                                fi
                                                ;;
                                esac
-                               verbose git config remote.origin.fetch "refs/heads/*:refs/remotes/origin/*"
+                               verbose git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
+                                       # TODO remove this line later
+
+                               verbose git config core.autocrlf false
+                               verbose git config core.safecrlf false # we don't NEED that...
 
                                r=`git symbolic-ref HEAD`
                                r=${r#refs/heads/}
                                if git config branch.$r.remote >/dev/null 2>&1; then
                                        if ! verbose git pull; then
                                                check_mergeconflict "$d"
-                                               exit 1 # FATAL
+                                               echo "Pulling failed. Press ENTER to continue, or Ctrl-C to abort."
+                                               read -r DUMMY
                                        fi
                                fi
 
@@ -226,13 +243,17 @@ case "$cmd" in
                                dv=`visible_repo_name "$d"`
                                enter "$d0/$d" verbose
                                a=
-                               while [ x"$a" != x"y" -a x"$a" != x"n" ]; do
-                                       echo "Branch in $dv?"
-                                       read -r a
-                               done
-                               if [ x"$a" = x"y" ]; then
-                                       verbose git push "$remote" "$srcbranch":"$branch"
-                                       verbose git checkout --track -b "$branch" "$remote/$branch"
+                               if git rev-parse "refs/heads/$branch" >/dev/null 2>&1; then
+                                       echo "Already having this branch in $dv."
+                               else
+                                       while [ x"$a" != x"y" -a x"$a" != x"n" ]; do
+                                               echo "Branch in $dv?"
+                                               read -r a
+                                       done
+                                       if [ x"$a" = x"y" ]; then
+                                               verbose git push "$remote" "$srcbranch":"$branch"
+                                               verbose git checkout --track -b "$branch" "$remote/$branch"
+                                       fi
                                fi
                                cd "$d0"
                        done
@@ -292,6 +313,7 @@ case "$cmd" in
                done
                ;;
        push|commit)
+               submit=$1
                for d in $repos; do
                        dv=`visible_repo_name "$d"`
                        enter "$d0/$d" verbose
@@ -308,16 +330,24 @@ case "$cmd" in
                                        verbose git commit -a
                                fi
                        fi
-                       if git log "origin/$r".."$r" | grep .; then
+                       rem=`git config "branch.$r.remote" || echo origin`
+                       if git log "$rem/$r".."$r" | grep .; then
                                a=
                                while [ x"$a" != x"y" -a x"$a" != x"n" ]; do
                                        echo "Push \"$r\" in $dv?"
                                        read -r a
                                done
                                if [ x"$a" = x"y" ]; then
-                                       verbose git push `git config "branch.$r.remote" || echo origin` HEAD
+                                       verbose git push "$rem" HEAD
                                fi
                        fi
+                       if [ x"$submit" = x"-s" ]; then
+                               case "$r" in
+                                       */*)
+                                               verbose git push "$rem" HEAD:"${r%%/*}/finished/${r#*/}"
+                                               ;;
+                               esac
+                       fi
                        cd "$d0"
                done
                ;;
@@ -337,10 +367,17 @@ case "$cmd" in
                enter "$d0/darkplaces" verbose
                verbose make $MAKEFLAGS sv-debug
                verbose make $MAKEFLAGS cl-debug
-               verbose make $MAKEFLAGS sdl-debug
+               if ! [ -n "$WE_HATE_OUR_USERS" ]; then
+                       verbose make $MAKEFLAGS sdl-debug
+               fi
                ;;
        run)
-               client=-sdl
+               if [ -n "$WE_HATE_OUR_USERS" ]; then
+                       client=
+                       export PATH="$d0/misc/buildfiles/w32:$PATH"
+               else
+                       client=-sdl
+               fi
                case "$1" in
                        sdl|glx|agl|dedicated)
                                client=-$1
@@ -430,11 +467,46 @@ case "$cmd" in
                done
                rm -rf "$patchdir"
                ;;
+       admin-merge)
+               for d in $repos; do
+                       enter "$d0/$d" verbose
+                       git rev-parse "$1/$2" || continue
+                       # 1. review
+                       {
+                               git log HEAD.."$1/$2"
+                               git diff HEAD..."$1/$2"
+                       } | less
+                       a=
+                       while [ x"$a" != x"y" -a x"$a" != x"n" ]; do
+                               echo "Merge \"$1/$2\" into `git symbolic-ref HEAD` of $d?"
+                               read -r a
+                       done
+                       if [ x"$a" = x"y" ]; then
+                               git merge "$1/$2"
+                               cd "$d0"
+                               a=
+                               if ! "$SELF" compile; then
+                                       a=n
+                               fi
+                               cd "$d0/$d"
+                               while [ x"$a" != x"y" -a x"$a" != x"n" ]; do
+                                       echo "Still merge \"$1/$2\" into `git symbolic-ref HEAD` of $d? Maybe you want to test first."
+                                       read -r a
+                               done
+                               if [ x"$a" = x"y" ]; then
+                                       git push origin HEAD
+                                       git push "$1" :"$2"
+                               else
+                                       git reset --hard HEAD@{1}
+                               fi
+                       fi
+               done
+               ;;
        *)
                echo "Usage:"
                echo "  $SELF pull"
                echo "  $SELF merge"
-               echo "  $SELF push"
+               echo "  $SELF push [-s]"
                echo "  $SELF branches"
                echo "  $SELF branch [<remote>] <branchname>"
                echo "  $SELF branch <remote> <branchname> <srcbranchname>"