]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - all
make this script work with all "echo"s :P
[xonotic/xonotic.git] / all
diff --git a/all b/all
index 5088768147a66b41e21800a0790310655d2ca20f..1685f3620fbcde9ff72c8d0e170021ed3be34e8a 100755 (executable)
--- a/all
+++ b/all
@@ -108,7 +108,10 @@ yesno()
        while [ x"$yesno" != x"y" -a x"$yesno" != x"n" ]; do
                eval "$2"
                $ECHO "$1"
-               IFS= read -r yesno
+               if ! IFS= read -r yesno; then
+                       yesno=n
+                       break
+               fi
        done
        [ x"$yesno" = x"y" ]
 }
@@ -235,7 +238,7 @@ listrepos()
                fi
                # if we have .no file, skip
                if [ -f "$d.no" ]; then
-                       msg "Repository $d disabled by a .no file, delete $p.no to enable"
+                       msg "Repository $d disabled by a .no file, delete $d.no to enable"
                        continue
                fi
                # if we have matching pk3, skip
@@ -359,7 +362,7 @@ mkzip()
 
 mkzip0()
 {
-       zip -0y "$@"
+       zip -0ry "$@"
 }
 
 mirrorspeed()
@@ -376,6 +379,7 @@ bestmirror()
        suf=$1; shift
 
        if ! { time -p true; } >/dev/null 2>&1; then
+               msg "Cannot do timing in this shell"
                return 1
        fi
 
@@ -543,7 +547,6 @@ case "$cmd" in
                case "$location" in
                        current)
                                if [ x"`git config xonotic.all.mirrorselection 2>/dev/null || true`" != x"done" ]; then
-                                       git config xonotic.all.mirrorselection done
                                        location=best
                                fi
                                ;;
@@ -561,7 +564,7 @@ case "$cmd" in
                                case "$newbase" in
                                        *\ *)
                                                if location=`bestmirror $newbase"xonotic.git" de us nl:'*6/5'`; then # 20% malus to the NL server to not overload it too much
-                                                       :
+                                                       git config xonotic.all.mirrorselection done
                                                else
                                                        location=current
                                                fi
@@ -608,6 +611,11 @@ case "$cmd" in
                        pushurl=`repopushurl "$d"`
                        branch=`repobranch "$d"`
                        if [ -d "$d0/$d" ]; then
+                               # if we have .no file, skip
+                               if [ -f "$d0/$d.no" ]; then
+                                       msg "Repository $d disabled by a .no file, delete $d.no to enable; thus, not updated"
+                                       continue
+                               fi
                                if $allow_pull; then
                                        enter "$d0/$d" verbose
                                        r=`git symbolic-ref HEAD`
@@ -847,8 +855,15 @@ case "$cmd" in
                                        cleanqc=true
                                        shift
                                        ;;
-                               -r)
-                                       debug=release
+                               -r|-p)
+                                       case "$1" in
+                                               -p)
+                                                       debug=profile
+                                                       ;;
+                                               -r)
+                                                       debug=release
+                                                       ;;
+                                       esac
                                        export CC="$CC -g"
                                        case "`$CC -dumpversion`" in
                                                [5-9]*|[1-9][0-9]*|4.[3-9]*|4.[1-9][0-9]*)
@@ -934,7 +949,7 @@ case "$cmd" in
                        fi
                fi
 
-               enter "$d0/d0_blind_id" verbose
+               verbose cd "$d0/d0_blind_id"
                if ! $compiled0; then
                        # compilation of crypto library failed
                        # use binaries then, if we can...
@@ -987,20 +1002,20 @@ case "$cmd" in
                        verbose make $MAKEFLAGS
                fi
 
-               enter "$d0/fteqcc" verbose
+               verbose cd "$d0/fteqcc"
                if $cleanqcc; then
                        verbose make $MAKEFLAGS clean
                fi
                verbose make $MAKEFLAGS
 
-               enter "$d0/data/xonotic-data.pk3dir" verbose
+               verbose cd "$d0/data/xonotic-data.pk3dir"
                if $cleanqc; then
                        verbose make FTEQCC="../../../../fteqcc/fteqcc.bin" "$@" $MAKEFLAGS clean
                fi
                verbose make FTEQCC="../../../../fteqcc/fteqcc.bin" "$@" $MAKEFLAGS
                # 4 levels up: data, xonotic-data, qcsrc, server
 
-               enter "$d0/darkplaces" verbose
+               verbose cd "$d0/darkplaces"
                if [ x"$BAD_TARGETS" = x" " ]; then
                        $ECHO "Warning: invalid empty client, default clients will be used."
                fi
@@ -1902,8 +1917,9 @@ case "$cmd" in
                        Xonotic/data/xonotic-$stamp-maps-high.pk3 \
                        Xonotic/data/xonotic-$stamp-music.pk3 \
                        Xonotic/data/xonotic-$stamp-nexcompat-high.pk3
+               verbose mkzip Xonotic-$stamp-mappingsupport.zip \
+                       Xonotic/mapping
                verbose mkzip0 Xonotic-$stamp-mappingsupport.zip \
-                       Xonotic/mapping \
                        Xonotic/data/xonotic-$stamp-maps-low.pk3 # TODO add a Radiant build
                ;;
        release)
@@ -1925,7 +1941,7 @@ case "$cmd" in
                $ECHO "  $SELF checkout|switch <remote>/<branch>"
                $ECHO "  $SELF clean [-m] [-f | -fu | -fU] [-r] [-D]"
                $ECHO "  $SELF clean --reclone"
-               $ECHO "  $SELF compile [-c] [-r] [-0]"
+               $ECHO "  $SELF compile [-c] [-r|-p] [-0]"
                $ECHO "  $SELF each|foreach [-k] command..."
                $ECHO "  $SELF fix_upstream_rebase"
                $ECHO "  $SELF keygen"