]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/tools/xonotic-map-compiler-autobuild
Merge branch 'master' of git://de.git.xonotic.org/xonotic/xonotic
[xonotic/xonotic.git] / misc / tools / xonotic-map-compiler-autobuild
index 384123fcef7fbc6bdcaa0adbb8309681517cd691..ba99371ac14e7865896d86f3e89eba9cf69c029a 100755 (executable)
@@ -7,8 +7,8 @@ url_http=http://beta.xonotic.org/autobuild-bsp/
 url_ssh=xonotic-beta:autobuild-bsp/
 build_cachedir="$HOME/xonotic-map-compiler.cache/"
 screenshot_cachedir="$HOME/xonotic-map-screenshot.cache/"
-build_override="-bsp_timeout 900 -vis_timeout 3600 -light_timeout 14400 -minimap_timeout 900 -scale_timeout 900"
-screenshot_override="9 600 +g_ctf 1"
+build_override="-bsp_timeout 1800 -vis_timeout 3600 -light_timeout 14400 -minimap_timeout 900 -scale_timeout 900"
+screenshot_override="9 900 5 +g_ctf 1"
 
 getthemap_fail=false
 
@@ -163,7 +163,7 @@ buildthemap()
        M=$3
        blobhash=$4
        commithash=$5
-       if HEAD "$url$M-$blobhash.pk3"; then
+       if lwp-request -m HEAD "$url$M-$blobhash.pk3"; then
                continue
        fi
 
@@ -213,7 +213,7 @@ screenshotthemap()
        M=$3
        blobhash=$4
        commithash=$5
-       if HEAD "$url$M-$blobhash/"; then
+       if lwp-request -m HEAD "$url$M-$blobhash/"; then
                continue
        fi
 
@@ -223,14 +223,22 @@ screenshotthemap()
        fi
 
        rm -rf ~/.xonotic
+       mkdir -p ~/.xonotic
        (
                cd ../..
                if [ -n "$DISPLAY" ]; then
-                       misc/tools/xonotic-map-screenshot "$M" $screenshot_override +"scr_screenshot_name \"$M-\""
+                       misc/tools/xonotic-map-screenshot "$M" $screenshot_override $DRIVERFLAGS +"scr_screenshot_name \"$M-\""
                else
-                       startx "$PWD/misc/tools/xonotic-map-screenshot" "$M" $screenshot_override +"scr_screenshot_name \"$M-\"" -- :8
+                       case "$DRIVER" in
+                               gl)
+                                       startx "$PWD/misc/tools/xonotic-map-screenshot" "$M" $screenshot_override $DRIVERFLAGS +"scr_screenshot_name \"$M-\"" -- :8
+                                       ;;
+                               soft|*)
+                                       startx "$PWD/misc/tools/xonotic-map-screenshot" "$M" $screenshot_override +"vid_soft 1" $DRIVERFLAGS +"scr_screenshot_name \"$M-\"" -- /usr/bin/Xvfb :8 -screen 0 1024x768x24
+                                       ;;
+                       esac
                fi
-       )
+       ) >~/.xonotic/autoscreenshot.log 2>&1
        if ! mv ~/.xonotic/data/screenshots "$M-$blobhash"; then
                if [ -n "$IRCSPAM" ]; then
                        #ss2spam "$M" "$url$M-$blobhash/" "$REFNAME" "$commithash" 1 > "maps/$M.ircss"
@@ -238,6 +246,7 @@ screenshotthemap()
                fi
                return 1
        fi
+       mv ~/.xonotic/autoscreenshot.log "$M-$blobhash"/ || true
        if [ -n "$IRCSPAM" ]; then
                #ss2spam "$M" "$url$M-$blobhash/" "$REFNAME" "$commithash" 0 > "maps/$M.ircss"
                ss2spam "$M" "$url?d" "$REFNAME" "$commithash" 0 > "maps/$M.ircss"
@@ -260,9 +269,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"
@@ -353,7 +364,10 @@ case "$1" in
                runmakeindex
                ;;
        download)
-               cd data/xonotic-maps.pk3dir
+               if ! cd data/xonotic-maps.pk3dir >/dev/null 2>&1; then
+                       echo "data/xonotic-maps.pk3dir does not exist, not downloading"
+                       exit 0
+               fi
                rundownload
                cd ../..
                echo "List of maps that got deleted (if any) and currently are in $bspdir.old:"