From: Thomas V. S. <tho...@us...> - 2003-06-02 19:54:37
|
CVS Root: /cvsroot/gstreamer Module: CVSROOT Changes by: thomasvs Date: Mon Jun 02 2003 12:54:36 PDT Log message: last try Added files: . : ciabot Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/CVSROOT/ciabot?rev=1.1&content-type=text/vnd.viewcvs-markup ====Begin Diffs==== --- NEW FILE: ciabot --- #!/bin/bash # This script should be called as "ciabot %{}" from loginfo. # Sample loginfo line: # ALL $CVSROOT/CVSROOT/ciabot %{} # Put that in your CVSROOT/loginfo, then set the variables at the top of this # script. Then commit this file to your CVSROOT, and add it to # CVSROOT/checkoutlist, and # echo | mail -s "JoinChannel #myproject" co...@pi... projectname="GStreamer" # will announce to channel #<whatever you put here> returnaddress="ad...@gs..." # You should turn stripnewlines on if you tend to write short blocks # of text, and off if you tend to have any formatting. If you stick # full changelog entries in your commit messages, definitely turn it # off. stripnewlines=false #stripnewlines=true # Deliver directly to the bot: #commitaddress="co...@pi..." # Sourceforge projects might need to deliver via users.sf.net (slower) commitaddress="ci...@us..." #################### End of what you'll generally need to change echo -n "Notifying #${projectname}..." maxlines=6 message=`cat` uname=`id -un` lineno=`echo "$message" | grep -n "Log Message:" | awk -F: ' { print $1 } '` message=`echo "$message" | sed "1,${lineno}d"` newline=`echo` if [ "$message" != "`echo \"$message\" | head -n $maxlines`" ]; then # The following line appears to be the only way to insert a newline at # that place. message="`echo \"$message\" | head -n $(($maxlines - 1))` <...>" fi if $stripnewlines; then message=`echo -n "$message" | tr '\n\r' ' '` fi module=`echo $1 | cut -d/ -f1` tmpfile="/tmp/$RANDOM-$projectname" cat <<EOF >$tmpfile From: $returnaddress To: $commitaddress Content-Type: text/plain; Subject: Announce $projectname commit by $uname to $module: $message EOF if [ -e /tmp/lastlog-$projectname ]; then if ! diff /tmp/lastlog-$projectname $tmpfile &>/dev/null; then # there are differences, so this is a different commit cat $tmpfile | /usr/sbin/sendmail -t mv $tmpfile /tmp/lastlog-$projectname else # it's just cvs spamming us from another directory rm $tmpfile fi else cat $tmpfile | /usr/sbin/sendmail -t mv $tmpfile /tmp/lastlog-$projectname fi echo "done." |