]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - all
targets targets targets targets ;) ./all compile wgl
[xonotic/xonotic.git] / all
diff --git a/all b/all
index a5e00520bb069eec4cc152ed89745cf0ce98e947..15a98b79b908adf03a2fdb14155ec56ce402215d 100755 (executable)
--- a/all
+++ b/all
@@ -23,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
@@ -118,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
@@ -157,15 +168,16 @@ case "$cmd" in
                                verbose git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
                                        # TODO remove this line later
 
-                               verbose git config core.autocrlf input
-                               verbose git config core.safecrlf true
+                               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
 
@@ -231,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
@@ -336,6 +352,25 @@ case "$cmd" in
                done
                ;;
        compile)
+               if [ -n "$WE_HATE_OUR_USERS" ]; then
+                       TARGETS="sv-debug cl-debug"
+               else
+                       TARGETS="sv-debug cl-debug sdl-debug"
+               fi
+               case "$1" in
+                       sdl)
+                               TARGETS="sdl-debug"
+                               shift
+                               ;;
+                       glx|agl|wgl)
+                               TARGETS="cl-debug"
+                               shift
+                               ;;
+                       dedicated)
+                               TARGETS="sv-debug"
+                               shift
+                               ;;
+               esac
                if [ -z "$MAKEFLAGS" ]; then
                        if [ -f /proc/cpuinfo ]; then
                                ncpus=$((`grep -c '^processor   :' /proc/cpuinfo`+0))
@@ -349,12 +384,16 @@ case "$cmd" in
                enter "$d0/data/xonotic-data.pk3dir" verbose
                verbose make FTEQCC="$d0/fteqcc/fteqcc.bin" $MAKEFLAGS
                enter "$d0/darkplaces" verbose
-               verbose make $MAKEFLAGS sv-debug
-               verbose make $MAKEFLAGS cl-debug
-               verbose make $MAKEFLAGS sdl-debug
+               for T in $TARGETS; do
+                       verbose make $MAKEFLAGS "$T"
+               done
                ;;
        run)
-               client=-sdl
+               if [ -n "$WE_HATE_OUR_USERS" ]; then
+                       client=
+               else
+                       client=-sdl
+               fi
                case "$1" in
                        sdl|glx|agl|dedicated)
                                client=-$1
@@ -461,10 +500,21 @@ case "$cmd" in
                        if [ x"$a" = x"y" ]; then
                                git merge "$1/$2"
                                cd "$d0"
-                               "$SELF" compile
-                               cd "$d0/d"
-                               git push origin HEAD
-                               git push "$1" :"$2"
+                               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
                ;;