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 900 -vis_timeout 3600 -light_timeout 14400 -minimap_timeout 900 -scale_timeout 900"
11 screenshot_override="9 600 +g_ctf 1"
19 for F in `git ls-files "$commithash" -- maps/\*.map.options`; do
22 blobhash=`git rev-parse --revs-only "$commithash:maps/$M.map.options" || true`-`git rev-parse --revs-only "$commithash:maps/$M.map" || true`
29 "$@" "$M" "$blobhash" "$commithash"
42 branch=${branch##refs/heads/}
43 branch=${branch##refs/remotes/}
44 branch=${branch##origin/}
45 hash=`echo "$hash" | cut -c 1-7`
47 echo "[$branch $hash] starting map compile of $map"
58 branch=${branch##refs/heads/}
59 branch=${branch##refs/remotes/}
60 branch=${branch##origin/}
61 hash=`echo "$hash" | cut -c 1-7`
65 if [ "$status" -ne 0 ]; then
66 s_error="exited with status $status"
69 if [ -n "$s_error" ]; then
70 echo "[$branch $hash]
\ 34screenshots of $map could not be made: $s_error"
72 echo "[$branch $hash] screenshots of $map are available on $url"
85 hash=`echo "$hash" | cut -c 1-7`
87 branch=${branch##refs/heads/}
88 branch=${branch##refs/remotes/}
89 branch=${branch##origin/}
96 if [ "$status" -ne 0 ]; then
97 s_error="exited with status $status"
99 while IFS= read -r L; do
101 WARNING:\ surface\ at\ *\ too\ large\ for\ desired\ samplesize*)
103 if [ -z "$s_samplesize" ] || [ "$s" -gt "$s_samplesize" ]; then
107 WARNING:\ Couldn\'t\ find\ image\ for\ shader\ textures/NULL)
110 WARNING:\ Couldn\'t\ find\ image\ for\ shader\ *)
111 s_failshaders="$s_failshaders ${L##* }"
113 '******* leaked *******')
116 '************ ERROR ************')
121 s_failshaders=`echo "$s_failshaders" | sed "s, textures/, ,g"`
122 s_failshaders=${s_failshaders# }
123 if [ -n "$s_error" ]; then
124 echo -n "[$branch $hash]
\ 34failed"
126 echo -n "[$branch $hash] finished"
128 echo -n " map compile of $map ($url): $time sec"
129 if [ -n "$s_samplesize" ]; then
130 echo -n ", FIX samplesize >= $s_samplesize"
132 if [ -n "$s_failshaders" ]; then
133 if [ -n "`echo "$s_failshaders" | cut -d ' ' -f 4-`" ]; then
134 s_failshaders="`echo "$s_failshaders" | cut -d ' ' -f 1-3`..."
136 echo -n ", FIX shaders $s_failshaders"
138 if [ -n "$s_leaked" ]; then
141 if [ -n "$s_error" ]; then
142 s_error=`echo "$s_error" | sed "s,$PWD/\?,,g"`
143 echo -n ", ERROR: $s_error"
155 if HEAD "$url$M-$blobhash.pk3"; then
161 git checkout -f "$HASH"
163 if [ -n "$IRCSPAM" ]; then
164 pre2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$HASH" | $IRCSPAM
169 ../../../misc/tools/xonotic-map-compiler "$M" `grep ^- "$M.map.options" | cut -d '#' -f 1` $build_override > "$M.log"
174 if [ -n "$IRCSPAM" ]; then
175 cat "maps/$M.log" | log2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$HASH" "$status" "$dt" > "maps/$M.irc"
177 zip -9r "$M-$blobhash.pk3" "maps/$M.bsp" "maps/$M.log" "maps/$M.irc" "maps/$M/" "maps/$M.lin" "gfx/${M}_mini.tga"
178 ln -snf "../$M-$blobhash.pk3" "$M.pk3" # from ALL branches, so beware!
179 cp "$M-$blobhash.pk3" "$M-full-$blobhash.pk3"
180 zip -9r "$M-full-$blobhash.pk3" `git diff --name-only --diff-filter=ACMRTUXB master...HEAD` || true
181 ln -snf "../$M-full-$blobhash.pk3" "$M-full.pk3" # from ALL branches, so beware!
182 rsync -vaSHP "$M-$blobhash.pk3" "$M-full-$blobhash.pk3" "$url_ssh"
183 rsync -vaSHP "$M.pk3" "$M-full.pk3" "$url_ssh""latest/"
184 if [ -n "$IRCSPAM" ]; then
185 $IRCSPAM < "maps/$M.irc"
196 if HEAD "$url$M-$blobhash/"; then
202 git checkout -f "$HASH"
207 if [ -n "$DISPLAY" ]; then
208 misc/tools/xonotic-map-screenshot "$M" $screenshot_override +"scr_screenshot_name \"$M-\""
210 startx "$PWD/misc/tools/xonotic-map-screenshot" "$M" $screenshot_override +"scr_screenshot_name \"$M-\"" -- :8
213 if ! mv ~/.xonotic/data/screenshots "$M-$blobhash"; then
214 if [ -n "$IRCSPAM" ]; then
215 #ss2spam "$M" "$url$M-$blobhash/" "$REFNAME" "$HASH" 1 > "maps/$M.ircss"
216 ss2spam "$M" "$url?d" "$REFNAME" "$HASH" 1 > "maps/$M.ircss"
220 if [ -n "$IRCSPAM" ]; then
221 #ss2spam "$M" "$url$M-$blobhash/" "$REFNAME" "$HASH" 0 > "maps/$M.ircss"
222 ss2spam "$M" "$url?d" "$REFNAME" "$HASH" 0 > "maps/$M.ircss"
224 chmod 1777 "$M-$blobhash"
225 ln -snf "../$M-$blobhash" "$M" # from ALL branches, so beware!
226 rsync -vaSHP "$M-$blobhash" "$url_ssh"
227 rsync -vaSHP "$M" "$url_ssh""latest/"
228 if [ -n "$IRCSPAM" ]; then
229 $IRCSPAM < "maps/$M.ircss"
241 if mv "$bspdir_old/$M-$blobhash.pk3" "$bspdir/$M-$blobhash.pk3"; then
244 if ! wget -O "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
245 if ! curl -o "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
246 rm -f "$bspdir/$M-$blobhash.pk3"
247 echo "WARNING: could not download $url$M-$blobhash.pk3, maybe not ready yet"
252 if ! unzip -l "$bspdir/$M-$blobhash.pk3"; then
253 rm -f "$bspdir/$M-$blobhash.pk3"
254 echo "WARNING: could not download $url$M-$blobhash.pk3, invalid zip file"
266 echo "$M $blobhash $HASH $REFNAME"
271 mkdir -p "$bspdir" "$bspdir.old"
272 for b in "$bspdir"/*-????????????????????????????????????????-????????????????????????????????????????.pk3; do
274 mv "$b" "$bspdir.old"/
277 cd data/xonotic-maps.pk3dir
278 allmaps "HEAD" getthemap "$url_http" "$bspdir.old" "$bspdir"
284 git for-each-ref 'refs/remotes' | grep -vE ' refs/remotes/([^/]*/HEAD|.*/archived/.*)$'
289 cd data/xonotic-maps.pk3dir
290 branches | while read -r HASH TYPE REFNAME; do
291 allmaps "$HASH" indexthemap "$REFNAME"
297 cd data/xonotic-maps.pk3dir
298 branches | while read -r HASH TYPE REFNAME; do
299 if [ -f "$build_cachedir/$HASH" ]; then
302 allmaps "$HASH" buildthemap "$REFNAME" "$url_http"
303 touch "$build_cachedir/$HASH"
305 git checkout -f master
308 cd data/xonotic-maps.pk3dir
309 runmakeindex > branches.idx.new
310 rsync -vaSHP "$branches.idx.new" "$url_ssh""branches.idx.new"
311 rm -f branches.idx.new
312 branches | while read -r HASH TYPE REFNAME; do
313 if [ -f "$screenshot_cachedir/$HASH" ]; then
318 if $getthemap_fail; then
322 cd data/xonotic-maps.pk3dir
324 allmaps "$HASH" screenshotthemap "$REFNAME" "$url_http"
325 touch "$screenshot_cachedir/$HASH"
327 git checkout -f master
334 echo "List of maps that got deleted (if any) and currently are in $bspdir.old:"
335 ls -l "$bspdir.old" || true
340 rm -f *-????????????????????????????????????????-????????????????????????????????????????.pk3
341 wget -r -l1 -A "*.pk3" -N --no-parent --no-directories "$url_http""latest"
344 log2spam "mapname" "http://mapurl" "branch" "commit" "0"