6 url_http=http://beta.xonotic.org/autobuild-bsp/
7 url_ssh=xonotic-beta:autobuild-bsp/
8 build_cachedir="$HOME/xonotic-map-compiler.cache/"
9 screenshot_cachedir="$HOME/xonotic-map-screenshot.cache/"
10 build_override="-bsp_timeout 5400 -vis_timeout 3600 -light_timeout 14400 -minimap_timeout 900 -scale_timeout 900"
11 screenshot_override="9 900 5 +g_ctf 1"
19 for F in `git show "${commithash}:maps/"`; do
28 blobhash=`git rev-parse --revs-only "${commithash}:maps/$M.map.options" || true`-`git rev-parse --revs-only "${commithash}:maps/$M.map" || true`
35 "$@" "$M" "$blobhash" "$commithash"
48 branch=${branch##refs/heads/}
49 branch=${branch##refs/remotes/}
50 branch=${branch##origin/}
51 hash=`echo "$hash" | cut -c 1-7`
53 echo "[$branch $hash] starting map compile of $map"
64 branch=${branch##refs/heads/}
65 branch=${branch##refs/remotes/}
66 branch=${branch##origin/}
67 hash=`echo "$hash" | cut -c 1-7`
71 if [ "$status" -ne 0 ]; then
72 s_error="exited with status $status"
75 if [ -n "$s_error" ]; then
76 echo "[$branch $hash]
\ 34screenshots of $map could not be made: $s_error"
78 echo "[$branch $hash] screenshots of $map are available on $url"
91 hash=`echo "$hash" | cut -c 1-7`
93 branch=${branch##refs/heads/}
94 branch=${branch##refs/remotes/}
95 branch=${branch##origin/}
102 if [ "$status" -ne 0 ]; then
103 s_error="exited with status $status"
105 while IFS= read -r L; do
107 WARNING:\ surface\ at\ *\ too\ large\ for\ desired\ samplesize*)
109 if [ -z "$s_samplesize" ] || [ "$s" -gt "$s_samplesize" ]; then
113 WARNING:\ Couldn\'t\ find\ image\ for\ shader\ textures/NULL)
116 WARNING:\ Couldn\'t\ find\ image\ for\ shader\ *)
117 s_failshaders="$s_failshaders ${L##* }"
120 if [ -z "$s_error" ]; then
124 '******* leaked *******')
127 '************ ERROR ************')
132 s_failshaders=`echo "$s_failshaders" | sed "s, textures/, ,g"`
133 s_failshaders=${s_failshaders# }
134 if [ -n "$s_error" ]; then
135 echo -n "[$branch $hash]
\ 34failed"
137 echo -n "[$branch $hash] finished"
139 echo -n " map compile of $map ($url): $time sec"
140 if [ -n "$s_samplesize" ]; then
141 echo -n ", FIX samplesize >= $s_samplesize"
143 if [ -n "$s_failshaders" ]; then
144 if [ -n "`echo "$s_failshaders" | cut -d ' ' -f 4-`" ]; then
145 s_failshaders="`echo "$s_failshaders" | cut -d ' ' -f 1-3`..."
147 echo -n ", FIX shaders $s_failshaders"
149 if [ -n "$s_leaked" ]; then
152 if [ -n "$s_error" ]; then
153 s_error=`echo "$s_error" | sed "s,$PWD/\?,,g"`
154 echo -n ", ERROR: $s_error"
166 if lwp-request -m HEAD "$url$M-$blobhash.pk3"; then
172 git checkout -f "$commithash"
174 if [ -n "$IRCSPAM" ]; then
175 pre2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$commithash" | $IRCSPAM || true
180 sz=`grep '^size ' "$M.mapinfo" 2>/dev/null || true`
181 if [ -n "$sz" ]; then
182 minimap_override="-minimap + -minmax ${sz#size }"
186 ../../../misc/tools/xonotic-map-compiler "$M" `grep ^- "$M.map.options" | cut -d '#' -f 1` $minimap_override $build_override > "$M.log" 2>&1
189 if ! [ -f "maps/$M.bsp" ]; then
190 echo >>"$M.log" "ERROR: No BSP file"
194 if [ -n "$IRCSPAM" ]; then
195 cat "maps/$M.log" | log2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$commithash" "$status" "$dt" > "maps/$M.irc"
197 zip -9r "$M-$blobhash.pk3" "maps/$M.bsp" "maps/$M.log" "maps/$M.irc" "maps/$M/" "maps/$M.lin" "gfx/${M}_mini.tga"
198 ln -snf "../$M-$blobhash.pk3" "$M.pk3" # from ALL branches, so beware!
199 cp "$M-$blobhash.pk3" "$M-full-$blobhash.pk3"
200 zip -9r "$M-full-$blobhash.pk3" `git diff --name-only --diff-filter=ACMRTUXB master...HEAD` || true
201 ln -snf "../$M-full-$blobhash.pk3" "$M-full.pk3" # from ALL branches, so beware!
202 rsync -vaSHP "$M-$blobhash.pk3" "$M-full-$blobhash.pk3" "$url_ssh"
203 rsync -vaSHP "$M.pk3" "$M-full.pk3" "$url_ssh""latest/"
204 if [ -n "$IRCSPAM" ]; then
205 $IRCSPAM < "maps/$M.irc" || true
216 if lwp-request -m HEAD "$url$M-$blobhash/"; then
220 if ! unzip -l "$bspdir/$M-$blobhash.pk3" "maps/$M.bsp"; then
225 rm -rf ~/.xonotic/data
226 mkdir -p ~/.xonotic/data
229 if [ -n "$DISPLAY" ]; then
230 misc/tools/xonotic-map-screenshot "$M" $screenshot_override $DRIVERFLAGS +"scr_screenshot_name \"$M-\""
234 startx "$PWD/misc/tools/xonotic-map-screenshot" "$M" $screenshot_override $DRIVERFLAGS +"scr_screenshot_name \"$M-\"" -- :8
237 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
241 ) 2>&1 | tee ~/.xonotic/data/autoscreenshot.log
243 if mv ~/.xonotic/data/screenshots "$M-$blobhash"; then
244 ss2spam "$M" "$url?d" "$REFNAME" "$commithash" 0 > ~/.xonotic/data/"$M.ircss"
247 ss2spam "$M" "$url?d" "$REFNAME" "$commithash" 1 > ~/.xonotic/data/"$M.ircss"
249 mv ~/.xonotic/data/"$M.ircss" "$M-$blobhash"/
250 mv ~/.xonotic/data/autoscreenshot.log "$M-$blobhash"/
251 chmod 1777 "$M-$blobhash"
252 ln -snf "../$M-$blobhash" "$M" # from ALL branches, so beware!
253 rsync -vaSHP "$M-$blobhash" "$url_ssh"
254 rsync -vaSHP "$M" "$url_ssh""latest/"
255 if [ -n "$IRCSPAM" ]; then
256 $IRCSPAM < "$M-$blobhash/$M.ircss" || true
268 if mv "$bspdir_old/$M-$blobhash.pk3" "$bspdir/$M-$blobhash.pk3"; then
269 if unzip -l "$bspdir/$M-$blobhash.pk3" >/dev/null 2>&1; then
273 if ! wget -c -O "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
274 if ! curl -o "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
275 rm -f "$bspdir/$M-$blobhash.pk3"
276 echo "WARNING: could not download $url$M-$blobhash.pk3, maybe not ready yet"
281 if ! unzip -l "$bspdir/$M-$blobhash.pk3"; then
282 rm -f "$bspdir/$M-$blobhash.pk3"
283 echo "WARNING: could not download $url$M-$blobhash.pk3, invalid zip file"
295 echo "$M $blobhash $commithash $REFNAME"
300 mkdir -p "$bspdir" "$bspdir.old"
301 for b in "$bspdir"/*-????????????????????????????????????????-????????????????????????????????????????.pk3; do
303 mv "$b" "$bspdir.old"/
306 allmaps "HEAD" getthemap "$url_http" "$bspdir.old" "$bspdir"
311 git for-each-ref 'refs/remotes' | grep -vE ' refs/remotes/([^/]*/HEAD|.*/archived/.*)$'
316 cd data/xonotic-maps.pk3dir
317 branches | while read -r HASH TYPE REFNAME; do
318 allmaps "$HASH" indexthemap "$REFNAME"
325 cd data/xonotic-maps.pk3dir
326 branches | while read -r HASH TYPE REFNAME; do
327 if [ -f "$build_cachedir/$HASH" ]; then
330 allmaps "$HASH" buildthemap "$REFNAME" "$url_http"
331 touch "$build_cachedir/$HASH"
333 git checkout -f master
336 runmakeindex > "branches.idx.new"
337 rsync -vaSHP "branches.idx.new" "$url_ssh""branches.idx.new"
338 rm -f "branches.idx.new"
339 cd data/xonotic-maps.pk3dir
340 branches | while read -r HASH TYPE REFNAME; do
341 if [ -f "$screenshot_cachedir/$HASH" ]; then
347 git checkout -f "$HASH"
350 if $getthemap_fail; then
354 allmaps "$HASH" screenshotthemap "$REFNAME" "$url_http"
356 touch "$screenshot_cachedir/$HASH"
358 git checkout -f master
364 if ! cd data/xonotic-maps.pk3dir >/dev/null 2>&1; then
365 echo "data/xonotic-maps.pk3dir does not exist, not downloading"
370 echo "List of maps that got deleted (if any) and currently are in $bspdir.old:"
371 ls -l "$bspdir.old" || true
376 rm -f *-????????????????????????????????????????-????????????????????????????????????????.pk3
377 wget -r -l1 -A "*.pk3" -N --no-parent --no-directories "$url_http""latest"
380 log2spam "mapname" "http://mapurl" "branch" "commit" "0"