6 url=http://beta.xonotic.org/autobuild-bsp/
7 url_ssh=beta.xonotic.org:autobuild-bsp/
8 override="-bsp_timeout 900 -vis_timeout 3600 -light_timeout 14400 -minimap_timeout 900 -scale_timeout 900"
12 for F in maps/*.map.options; do
13 if ! [ -f "$F" ]; then
16 if ! [ -f "${F%.options}" ]; then
21 blobhash=`git ls-files -s -- "$F" | cut -d ' ' -f 2`-`git ls-files -s -- "${F%.options}" | cut -d ' ' -f 2`
33 branch=${branch##refs/heads/}
34 branch=${branch##refs/remotes/}
35 branch=${branch##origin/}
36 hash=`echo "$hash" | cut -c 1-7`
38 echo "[$branch $hash] starting map compile of $map"
50 hash=`echo "$hash" | cut -c 1-7`
52 branch=${branch##refs/heads/}
53 branch=${branch##refs/remotes/}
54 branch=${branch##origin/}
61 if [ "$status" -ne 0 ]; then
62 s_error="exited with status $status"
64 while IFS= read -r L; do
66 WARNING:\ surface\ at\ *\ too\ large\ for\ desired\ samplesize*)
68 if [ -z "$s_samplesize" ] || [ "$s" -gt "$s_samplesize" ]; then
72 WARNING:\ Couldn\'t\ find\ image\ for\ shader\ textures/NULL)
75 WARNING:\ Couldn\'t\ find\ image\ for\ shader\ *)
76 s_failshaders="$s_failshaders ${L##* }"
78 '******* leaked *******')
81 '************ ERROR ************')
86 s_failshaders=`echo "$s_failshaders" | sed "s, textures/, ,g"`
87 s_failshaders=${s_failshaders# }
88 if [ -n "$s_error" ]; then
89 echo -n "[$branch $hash]
\ 34failed"
91 echo -n "[$branch $hash] finished"
93 echo -n " map compile of $map ($url): $time sec"
94 if [ -n "$s_samplesize" ]; then
95 echo -n ", FIX samplesize >= $s_samplesize"
97 if [ -n "$s_failshaders" ]; then
98 if [ -n "`echo "$s_failshaders" | cut -d ' ' -f 4-`" ]; then
99 s_failshaders="`echo "$s_failshaders" | cut -d ' ' -f 1-3`..."
101 echo -n ", FIX shaders $s_failshaders"
103 if [ -n "$s_leaked" ]; then
106 if [ -n "$s_error" ]; then
107 s_error=`echo "$s_error" | sed "s,$PWD/\?,,g"`
108 echo -n ", ERROR: $s_error"
121 if [ -f "$bspdir/$M-$blobhash.pk3" ]; then
124 if [ -n "$IRCSPAM" ]; then
125 pre2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$HASH" | $IRCSPAM
130 ../../../misc/tools/xonotic-map-compiler "$M" `grep ^- "$M.map.options" | cut -d '#' -f 1` $override > "$M.log"
135 if [ -n "$IRCSPAM" ]; then
136 cat "maps/$M.log" | log2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$HASH" "$status" "$dt" > "maps/$M.irc"
138 zip -9r "$M-$blobhash.pk3" "maps/$M.bsp" "maps/$M.log" "maps/$M.irc" "maps/$M/" "maps/$M.lin" "gfx/${M}_mini.tga"
139 ln -snf "../$M-$blobhash.pk3" "$M.pk3" # from ALL branches, so beware!
140 rsync -vaSHP "$M-$blobhash.pk3" "$url_ssh"
141 rsync -vaSHP "$M.pk3" "$url_ssh""latest/"
143 if [ -n "$IRCSPAM" ]; then
144 $IRCSPAM < "maps/$M.irc"
155 if mv "$bspdir_old/$M-$blobhash.pk3" "$bspdir/$M-$blobhash.pk3"; then
158 if ! wget -O "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
159 if ! curl -o "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
160 rm -f "$bspdir/$M-$blobhash.pk3"
161 echo "WARNING: could not download $url$M-$blobhash.pk3, maybe not ready yet"
165 if ! unzip -l "$bspdir/$M-$blobhash.pk3"; then
166 rm -f "$bspdir/$M-$blobhash.pk3"
167 echo "WARNING: could not download $url$M-$blobhash.pk3, invalid zip file"
174 cd data/xonotic-maps.pk3dir
175 git for-each-ref 'refs/remotes' | while read -r HASH TYPE REFNAME; do
178 git checkout -f "$HASH"
179 allmaps buildthemap "$REFNAME" "$HASH" "$url" "$bspoutdir"
181 git checkout -f master
184 mkdir -p "$bspdir" "$bspdir.old"
185 for b in "$bspdir"/*-????????????????????????????????????????-????????????????????????????????????????.pk3; do
187 mv "$b" "$bspdir.old"/
190 cd data/xonotic-maps.pk3dir
191 allmaps getthemap "$url" "$bspdir.old" "$bspdir"
192 echo "List of maps that got deleted (if any) and currently are in $bspdir.old:"
198 rm -f *-????????????????????????????????????????-????????????????????????????????????????.pk3
199 wget -r -l1 -A "*.pk3" -N --no-parent --no-directories "$url""latest"
202 log2spam "mapname" "http://mapurl" "branch" "commit" "0"