Merge branch 'master' of ssh://git.xonotic.org/xonotic
authorRudolf Polzer <divverent@alientrap.org>
Thu, 17 Jun 2010 07:20:48 +0000 (09:20 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 17 Jun 2010 07:20:48 +0000 (09:20 +0200)
all
misc/tools/xonotic-map-compiler-autobuild

diff --git a/all b/all
index 8b2caa053f7382a23ca821f1192265dc69f70529..b88931b4813bc5fb03d40b3ef268cb36014e1c2a 100755 (executable)
--- a/all
+++ b/all
@@ -676,7 +676,7 @@ case "$cmd" in
                                                ;;
                                esac
                                reportecho "  Branch $ref:"
-                               note=`git notes --ref "refs/notes/admin-merge" show "$ref" 2>/dev/null || true`
+                               note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
                                if [ -n "$note" ]; then
                                        reportdo4 echo "$note"
                                        reportecho4 "--> not merging, already had this one rejected before"
@@ -685,18 +685,18 @@ case "$cmd" in
                                        org=`git rev-parse HEAD`
                                        if ! git merge "$ref" 2>&1 | tee "$t"; then
                                                git reset --hard "$org"
-                                               git notes --ref "refs/notes/admin-merge" add -m "Merge failed:$LF`cat "$t"`" "$ref"
+                                               GIT_NOTES_REF=refs/notes/admin-merge git notes edit -m "Merge failed:$LF`cat "$t"`" "$ref"
                                                reportdo4 cat "$t"
                                                reportecho4 "--> merge failed"
                                        elif ! "$SELF" compile 2>&1 | tee "$t"; then
                                                git reset --hard "$org"
-                                               git notes --ref "refs/notes/admin-merge" add -m "Compile failed:$LF`cat "$t"`" "$ref"
+                                               GIT_NOTES_REF=refs/notes/admin-merge git notes edit -m "Compile failed:$LF`cat "$t"`" "$ref"
                                                reportdo4 cat "$t"
                                                reportecho4 "--> compile failed"
                                        elif ! yesno "Still merge \"$ref\" into `git symbolic-ref HEAD` of $d? Maybe you want to test first."; then
                                                git reset --hard "$org"
-                                               git notes --ref "refs/notes/admin-merge" add "$ref"
-                                               note=`git notes --ref "refs/notes/admin-merge" show "$ref" 2>/dev/null || true`
+                                               git notes edit "$ref"
+                                               note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
                                                reportdo4 echo "$note"
                                                reportecho4 "--> test failed"
                                        else
@@ -720,7 +720,7 @@ case "$cmd" in
                                        fi
                                else
                                        git notes --ref "refs/notes/admin-merge" add "$ref"
-                                       note=`git notes --ref "refs/notes/admin-merge" show "$ref" 2>/dev/null || true`
+                                       note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
                                        if [ -n "$note" ]; then
                                                reportdo4 echo "$note"
                                                reportecho4 "--> rejected"
index bab7adc14e87ea17045ea48bf2fa3856fd017768..29cd9e09115e77c296afae9a172459bceeb946e3 100755 (executable)
@@ -23,11 +23,83 @@ allmaps()
        done
 }
 
+log2spam()
+{
+       map=$1
+       url=$2
+       branch=$3
+       hash=$4
+
+       branch=${branch##refs/heads/}
+       branch=${branch##refs/remotes/}
+       branch=${branch##origin/}
+
+       s_time=
+       s_samplesize=
+       s_failshaders=
+       s_leaked=
+       s_error=
+
+       while IFS= read -r L; do
+               case "$L" in
+                       *\ seconds\ elapsed)
+                               s_time=$(($s_time + ${L%% seconds elapsed}))
+                               ;;
+                       WARNING:\ surface\ at\ *\ too\ large\ for\ desired\ samplesize*)
+                               s=${L##* }
+                               if [ -z "$s_samplesize" ] || [ "$s" -gt "$s_samplesize" ]; then
+                                       s_samplesize=$s
+                               fi
+                               ;;
+                       WARNING:\ Couldn\'t\ find\ image\ for\ shader\ textures/NULL)
+                               # radiant stupid
+                               ;;
+                       WARNING:\ Couldn\'t\ find\ image\ for\ shader\ *)
+                               s_failshaders="$s_failshaders ${L##* }"
+                               ;;
+                       '******* leaked *******')
+                               s_leaked=1
+                               ;;
+                       '************ ERROR ************')
+                               IFS= read -r s_error
+                               ;;
+               esac
+       done
+       s_failshaders=`echo "$s_failshaders" | sed "s, textures/, ,g"`
+       s_failshaders=${s_failshaders# }
+       if [ -n "$s_error" ]; then
+               echo -n "[$branch] \ 34failed"
+       else
+               echo -n "[$branch] finished"
+       fi
+       echo -n " map compile of $map ($url): $s_time sec"
+       if [ -n "$s_samplesize" ]; then
+               echo -n ", FIX samplesize >= $s_samplesize"
+       fi
+       if [ -n "$s_failshaders" ]; then
+               if [ -n "`echo "$s_failshaders" | cut -d ' ' -f 4-`" ]; then
+                       s_failshaders="`echo "$s_failshaders" | cut -d ' ' -f 1-3`..."
+               fi
+               echo -n ", FIX shaders $s_failshaders"
+       fi
+       if [ -n "$s_leaked" ]; then
+               echo -n ", FIX LEAK"
+       fi
+       if [ -n "$s_error" ]; then
+               s_error=`echo "$s_error" | sed "s,$PWD/\?,,g"`
+               echo -n ", ERROR: $s_error"
+       fi
+       echo
+}
+
 buildthemap()
 {
-       bspdir=$1
-       M=$2
-       blobhash=$3
+       REFNAME=$1
+       HASH=$2
+       url=$3
+       bspdir=$4
+       M=$5
+       blobhash=$6
        if [ -f "$bspdir/$M-$blobhash.pk3" ]; then
                continue
        fi
@@ -37,6 +109,9 @@ buildthemap()
        )
        zip -9r "$bspdir/$M-$blobhash.pk3" "maps/$M.bsp" "maps/$M.log" "maps/$M/" "maps/$M.lin" "gfx/${M}_mini.tga"
        ln -snf "../$M-$blobhash.pk3" "$bspdir/latest/$M.pk3" # from ALL branches, so beware!
+       if [ -n "$IRCSPAM" ]; then
+               cat "maps/$M.log" | log2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$HASH" | $IRCSPAM
+       fi
 }
 
 getthemap()
@@ -70,7 +145,7 @@ case "$1" in
                        git reset --hard
                        git clean -xfd
                        git checkout "$HASH"
-                       allmaps buildthemap "$bspoutdir"
+                       allmaps buildthemap "$REFNAME" "$HASH" "$url" "$bspoutdir"
                done
                git checkout master
                ;;
@@ -87,6 +162,9 @@ case "$1" in
                mkdir -p "$bspdir"
                cd "$bspdir"
                rm -f *-????????????????????????????????????????-????????????????????????????????????????.pk3
-               wget -r -l1 -A "*.pk3" -N --no-parent --no-directories "$url/latest"
+               wget -r -l1 -A "*.pk3" -N --no-parent --no-directories "$url""latest"
+               ;;
+       log2spam-test)
+               log2spam "mapname" "http://mapurl" "branch" "commit"
                ;;
 esac