6 url=http://beta.xonotic.org/autobuild-bsp/
7 url_ssh=xonotic-beta:autobuild-bsp/
8 cachedir="$HOME/xonotic-map-compiler.cache/"
9 override="-bsp_timeout 900 -vis_timeout 3600 -light_timeout 14400 -minimap_timeout 900 -scale_timeout 900"
13 for F in maps/*.map.options; do
14 if ! [ -f "$F" ]; then
17 if ! [ -f "${F%.options}" ]; then
22 blobhash=`git ls-files -s -- "$F" | cut -d ' ' -f 2`-`git ls-files -s -- "${F%.options}" | cut -d ' ' -f 2`
34 branch=${branch##refs/heads/}
35 branch=${branch##refs/remotes/}
36 branch=${branch##origin/}
37 hash=`echo "$hash" | cut -c 1-7`
39 echo "[$branch $hash] starting map compile of $map"
51 hash=`echo "$hash" | cut -c 1-7`
53 branch=${branch##refs/heads/}
54 branch=${branch##refs/remotes/}
55 branch=${branch##origin/}
62 if [ "$status" -ne 0 ]; then
63 s_error="exited with status $status"
65 while IFS= read -r L; do
67 WARNING:\ surface\ at\ *\ too\ large\ for\ desired\ samplesize*)
69 if [ -z "$s_samplesize" ] || [ "$s" -gt "$s_samplesize" ]; then
73 WARNING:\ Couldn\'t\ find\ image\ for\ shader\ textures/NULL)
76 WARNING:\ Couldn\'t\ find\ image\ for\ shader\ *)
77 s_failshaders="$s_failshaders ${L##* }"
79 '******* leaked *******')
82 '************ ERROR ************')
87 s_failshaders=`echo "$s_failshaders" | sed "s, textures/, ,g"`
88 s_failshaders=${s_failshaders# }
89 if [ -n "$s_error" ]; then
90 echo -n "[$branch $hash]
\ 34failed"
92 echo -n "[$branch $hash] finished"
94 echo -n " map compile of $map ($url): $time sec"
95 if [ -n "$s_samplesize" ]; then
96 echo -n ", FIX samplesize >= $s_samplesize"
98 if [ -n "$s_failshaders" ]; then
99 if [ -n "`echo "$s_failshaders" | cut -d ' ' -f 4-`" ]; then
100 s_failshaders="`echo "$s_failshaders" | cut -d ' ' -f 1-3`..."
102 echo -n ", FIX shaders $s_failshaders"
104 if [ -n "$s_leaked" ]; then
107 if [ -n "$s_error" ]; then
108 s_error=`echo "$s_error" | sed "s,$PWD/\?,,g"`
109 echo -n ", ERROR: $s_error"
121 if HEAD "$url$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 cp "$M-$blobhash.pk3" "$M-full-$blobhash.pk3"
141 zip -9r "$M-full-$blobhash.pk3" `git diff --name-only --diff-filter=ACMRTUXB master...HEAD` || true
142 ln -snf "../$M-full-$blobhash.pk3" "$M-full.pk3" # from ALL branches, so beware!
143 rsync -vaSHP "$M-$blobhash.pk3" "$M-full-$blobhash.pk3" "$url_ssh"
144 rsync -vaSHP "$M.pk3" "$M-full.pk3" "$url_ssh""latest/"
145 if [ -n "$IRCSPAM" ]; then
146 $IRCSPAM < "maps/$M.irc"
157 if mv "$bspdir_old/$M-$blobhash.pk3" "$bspdir/$M-$blobhash.pk3"; then
160 if ! wget -O "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
161 if ! curl -o "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
162 rm -f "$bspdir/$M-$blobhash.pk3"
163 echo "WARNING: could not download $url$M-$blobhash.pk3, maybe not ready yet"
167 if ! unzip -l "$bspdir/$M-$blobhash.pk3"; then
168 rm -f "$bspdir/$M-$blobhash.pk3"
169 echo "WARNING: could not download $url$M-$blobhash.pk3, invalid zip file"
176 cd data/xonotic-maps.pk3dir
177 git for-each-ref 'refs/remotes' | while read -r HASH TYPE REFNAME; do
178 if [ -f "$cachedir/$HASH" ]; then
183 git checkout -f "$HASH"
184 allmaps buildthemap "$REFNAME" "$HASH" "$url"
185 touch "$cachedir/$HASH"
187 git checkout -f master
190 mkdir -p "$bspdir" "$bspdir.old"
191 for b in "$bspdir"/*-????????????????????????????????????????-????????????????????????????????????????.pk3; do
193 mv "$b" "$bspdir.old"/
196 cd data/xonotic-maps.pk3dir
197 allmaps getthemap "$url" "$bspdir.old" "$bspdir"
198 echo "List of maps that got deleted (if any) and currently are in $bspdir.old:"
204 rm -f *-????????????????????????????????????????-????????????????????????????????????????.pk3
205 wget -r -l1 -A "*.pk3" -N --no-parent --no-directories "$url""latest"
208 log2spam "mapname" "http://mapurl" "branch" "commit" "0"