6 url=http://141.2.16.23/~xonotic/bsp-autobuilds/
8 bspoutdir="$HOME/public_html/bsp-autobuilds/"
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/}
43 while IFS= read -r L; do
46 s_time=$(($s_time + ${L%% seconds elapsed}))
48 WARNING:\ surface\ at\ *\ too\ large\ for\ desired\ samplesize*)
50 if [ -z "$s_samplesize" ] || [ "$s" -gt "$s_samplesize" ]; then
54 WARNING:\ Couldn\'t\ find\ image\ for\ shader\ textures/NULL)
57 WARNING:\ Couldn\'t\ find\ image\ for\ shader\ *)
58 s_failshaders="$s_failshaders ${L##* }"
60 '******* leaked *******')
63 '************ ERROR ************')
68 s_failshaders=`echo "$s_failshaders" | sed "s, textures/, ,g"`
69 s_failshaders=${s_failshaders# }
70 if [ -n "$s_error" ]; then
71 echo -n "[$branch]
\ 34failed"
73 echo -n "[$branch] finished"
75 echo -n " map compile of $map ($url): $s_time sec"
76 if [ -n "$s_samplesize" ]; then
77 echo -n ", FIX samplesize >= $s_samplesize"
79 if [ -n "$s_failshaders" ]; then
80 if [ -n "`echo "$s_failshaders" | cut -d ' ' -f 4-`" ]; then
81 s_failshaders="`echo "$s_failshaders" | cut -d ' ' -f 1-3`..."
83 echo -n ", FIX shaders $s_failshaders"
85 if [ -n "$s_leaked" ]; then
88 if [ -n "$s_error" ]; then
89 s_error=`echo "$s_error" | sed "s,$PWD/\?,,g"`
90 echo -n ", ERROR: $s_error"
103 if [ -f "$bspdir/$M-$blobhash.pk3" ]; then
108 ../../../misc/tools/xonotic-map-compiler "$M" `head -n 1 "$M.map.options"` 2>&1 | tee "$M.log"
110 zip -9r "$bspdir/$M-$blobhash.pk3" "maps/$M.bsp" "maps/$M.log" "maps/$M/" "maps/$M.lin" "gfx/${M}_mini.tga"
111 ln -snf "../$M-$blobhash.pk3" "$bspdir/latest/$M.pk3" # from ALL branches, so beware!
112 if [ -n "$IRCSPAM" ]; then
113 cat "maps/$M.log" | log2spam "$M" "$url/$M-$blobhash.pk3" "$REFNAME" "$HASH" | $IRCSPAM
124 if mv "$bspdir_old/$M-$blobhash.pk3" "$bspdir/$M-$blobhash.pk3"; then
127 if ! wget -O "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
128 rm -f "$bspdir/$M-$blobhash.pk3"
129 echo "WARNING: could not download $url$M-$blobhash.pk3, maybe not ready yet"
132 if ! unzip -l "$bspdir/$M-$blobhash.pk3"; then
133 rm -f "$bspdir/$M-$blobhash.pk3"
134 echo "WARNING: could not download $url$M-$blobhash.pk3, invalid zip file"
141 mkdir -p "$bspoutdir"
142 mkdir -p "$bspoutdir/latest"
143 cd data/xonotic-maps.pk3dir
144 git for-each-ref 'refs/remotes' | while read -r HASH TYPE REFNAME; do
148 allmaps buildthemap "$REFNAME" "$HASH" "$url" "$bspoutdir"
154 mv "$bspdir" "$bspdir.old" || true
156 cd data/xonotic-maps.pk3dir
157 allmaps getthemap "$url" "$bspdir.old" "$bspdir"
158 echo "List of maps that got deleted (if any) and currently are in $bspdir.old:"
164 rm -f *-????????????????????????????????????????-????????????????????????????????????????.pk3
165 wget -r -l1 -A "*.pk3" -N --no-parent --no-directories "$url/latest"
168 log2spam "mapname" "http://mapurl" "branch" "commit"