]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/tools/xonotic-map-compiler-autobuild
Merge branch 'master' of git://git.xonotic.org/xonotic/xonotic
[xonotic/xonotic.git] / misc / tools / xonotic-map-compiler-autobuild
index ccfdfa69ff9935690daedb6952808493031ffe75..0fdcc501dfa9a39bbfe8b9746045679adf3fa952 100755 (executable)
@@ -116,6 +116,11 @@ log2spam()
                        WARNING:\ Couldn\'t\ find\ image\ for\ shader\ *)
                                s_failshaders="$s_failshaders ${L##* }"
                                ;;
+                       ERROR:\ *)
+                               if [ -z "$s_error" ]; then
+                                       s_error=$L
+                               fi
+                               ;;
                        '******* leaked *******')
                                s_leaked=1
                                ;;
@@ -172,11 +177,20 @@ buildthemap()
        t0=`date +%s`
        (
                cd maps
-               ../../../misc/tools/xonotic-map-compiler "$M" `grep ^- "$M.map.options" | cut -d '#' -f 1` $build_override > "$M.log"
+               sz=`grep '^size ' "$M.mapinfo" 2>/dev/null || true`
+               if [ -n "$sz" ]; then
+                       minimap_override="-minimap + -minmax ${sz#size }"
+               else
+                       minimap_override=
+               fi
+               ../../../misc/tools/xonotic-map-compiler "$M" `grep ^- "$M.map.options" | cut -d '#' -f 1` $minimap_override $build_override > "$M.log" 2>&1
        )
+       status=$?
+       if ! [ -f "maps/$M.bsp" ]; then
+               echo >>"$M.log" "ERROR: No BSP file"
+       fi
        t1=`date +%s`
        dt=$(($t1 - $t0))
-       status=$?
        if [ -n "$IRCSPAM" ]; then
                cat "maps/$M.log" | log2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$commithash" "$status" "$dt" > "maps/$M.irc"
        fi
@@ -203,9 +217,10 @@ screenshotthemap()
                continue
        fi
 
-       git reset --hard
-       git clean -xfd
-       git checkout -f "$commithash"
+       if ! unzip -l "$bspdir/$M-$blobhash.pk3" "maps/$M.bsp"; then
+               # no BSP file
+               continue
+       fi
 
        rm -rf ~/.xonotic
        (
@@ -245,9 +260,11 @@ getthemap()
        blobhash=$5
        commithash=$6
        if mv "$bspdir_old/$M-$blobhash.pk3" "$bspdir/$M-$blobhash.pk3"; then
-               continue
+               if unzip -l "$bspdir/$M-$blobhash.pk3" >/dev/null 2>&1; then
+                       return 0
+               fi
        fi
-       if ! wget -O "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
+       if ! wget -c -O "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
                if ! curl -o "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
                        rm -f "$bspdir/$M-$blobhash.pk3"
                        echo "WARNING: could not download $url$M-$blobhash.pk3, maybe not ready yet"
@@ -319,6 +336,10 @@ case "$1" in
                                continue
                        fi
 
+                       git reset --hard
+                       git clean -xfd
+                       git checkout -f "$HASH"
+
                        rundownload
                        if $getthemap_fail; then
                                continue