]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - all
try to handle the case if the branch has been remotely deleted in "push"
[xonotic/xonotic.git] / all
diff --git a/all b/all
index e19793567a34d224808a78fc4e1832b49a508248..09292ee0d19a0cf22d8e25041925523fa6247814 100755 (executable)
--- a/all
+++ b/all
@@ -119,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
@@ -233,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
@@ -317,7 +331,7 @@ case "$cmd" in
                                fi
                        fi
                        rem=`git config "branch.$r.remote" || echo origin`
-                       if git log "$rem/$r".."$r" | grep .; then
+                       if { git log "$rem/$r".."$r" || git log origin/master.."$r"; } | grep .; then
                                a=
                                while [ x"$a" != x"y" -a x"$a" != x"n" ]; do
                                        echo "Push \"$r\" in $dv?"
@@ -338,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))
@@ -351,15 +384,14 @@ 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
-               if ! [ -n "$WE_HATE_OUR_USERS" ]; then
-                       verbose make $MAKEFLAGS sdl-debug
-               fi
+               for T in $TARGETS; do
+                       verbose make $MAKEFLAGS "$T"
+               done
                ;;
        run)
                if [ -n "$WE_HATE_OUR_USERS" ]; then
                        client=
+                       export PATH="$d0/misc/buildfiles/w32:$PATH"
                else
                        client=-sdl
                fi