summaryrefslogtreecommitdiff
path: root/BitKeeper
diff options
context:
space:
mode:
authorChris Larson <clarson@kergoth.com>2004-01-16 03:23:01 +0000
committerChris Larson <clarson@kergoth.com>2004-01-16 03:23:01 +0000
commitbd2e59526e035373d4e44084e1b19cdfd2622d6d (patch)
treec08d71d8ef66dd46a7914eefccf92dcd227c6d8f /BitKeeper
parenta53f750766b3c6e0700a191007cd8befda21bce7 (diff)
Updates to the CIA notification stuff for tag and files handling.
BKrev: 40075915pmp-Cs4DIljPkLf9gy-XJA
Diffstat (limited to 'BitKeeper')
-rw-r--r--BitKeeper/triggers/ciabot_bk.sh79
-rw-r--r--BitKeeper/triggers/post-outgoing.ciabot10
2 files changed, 84 insertions, 5 deletions
diff --git a/BitKeeper/triggers/ciabot_bk.sh b/BitKeeper/triggers/ciabot_bk.sh
index e69de29bb2..a75be349ae 100644
--- a/BitKeeper/triggers/ciabot_bk.sh
+++ b/BitKeeper/triggers/ciabot_bk.sh
@@ -0,0 +1,79 @@
+#!/bin/sh
+#
+# CIA bot client script for BitKeeper repositories, delivering via email
+# -- Chris Larson <kergoth@handhelds.org>
+#
+# Based on ciabot_svn.sh by Micah Dowty <micah@picogui.org>
+#
+# See http://cia.navi.cx
+# for more information on what the CIA bot is and how it works.
+#
+############# There are some parameters for this script that you can customize:
+
+# Project information
+project_name="openembedded"
+return_address="oe@handhelds.org"
+
+# System
+sendmail_command="/usr/sbin/sendmail -t"
+
+############# Below this line you shouldn't have to change anything
+
+# Script arguments
+REV="$1"
+
+# The email address CIA lives at
+cia_address="cia@navi.cx"
+
+author=`echo $BK_USER | sed 's/\&/\&amp;/g;s/</\&lt;/g;s/>/\&gt;/g'`
+module=`basename $BKD_ROOT | sed 's/\&/\&amp;/g;s/</\&lt;/g;s/>/\&gt;/g'`
+log=`bk changes -r"$REV" -d":C:" | sed 's/\&/\&amp;/g;s/</\&lt;/g;s/>/\&gt;/g'`
+tag=`bk changes -r"$REV" -d":TAG:" | sed 's/\&/\&amp;/g;s/</\&lt;/g;s/>/\&gt;/g'`
+files=`bk changes -n -v -r"$REV" -d"\\\$unless(:GFILE:=ChangeSet){:GFILE:}" | sort -u | sed 's/\&/\&amp;/g;s/</\&lt;/g;s/>/\&gt;/g'`
+
+# Send an email with the final XML message
+(cat <<EOF
+From: $return_address
+To: $cia_address
+Content-type: text/xml
+Subject: DeliverXML
+
+<message>
+ <generator>
+ <name>BitKeeper CIA Bot client shell script</name>
+ <version>1.0</version>
+ </generator>
+ <source>
+ <project>$project_name</project>
+ <module>$module</module>
+EOF
+
+if test -n "$tag"; then
+ echo " <branch>$tag</branch>"
+fi
+
+cat <<EOF
+ </source>
+ <body>
+ <commit>
+ <revision>$REV</revision>
+ <author>$author</author>
+EOF
+
+if test -n "$files"; then
+ echo " <files>"
+ for f in $files; do
+ echo " <file>$f</file>"
+ done
+ echo " </files>"
+fi
+
+cat <<EOF
+ <log>$log</log>
+ </commit>
+ </body>
+</message>
+EOF
+) | tee ~/sendmailcmd.$$ | $sendmail_command
+
+### The End ###
diff --git a/BitKeeper/triggers/post-outgoing.ciabot b/BitKeeper/triggers/post-outgoing.ciabot
index 37dbeda5e6..0a424ffb18 100644
--- a/BitKeeper/triggers/post-outgoing.ciabot
+++ b/BitKeeper/triggers/post-outgoing.ciabot
@@ -10,9 +10,9 @@ check_sanity () {
# is on bkbits.net and b) we are the client.
# Is parent a public BitKeeper repository at bkbits.net?
- if !(echo $BKD_HOST|grep -q bitkeeper.com); then
- return 1
- fi
+# if !(echo $BKD_HOST|grep -q bitkeeper.com); then
+# return 1
+# fi
if [ $BK_SIDE != client ]; then
return 1
@@ -22,13 +22,13 @@ check_sanity () {
# Check sanity - do we need to send anything?
check_sanity || exit 0
-# convert numbers from the cset list into something useful
+# Convert numbers from the cset list into something useful
nums=
for s in `cat $BK_CSETLIST`; do
nums="`bk prs -h -d\"\\\$if(:DS: -eq $s){:REV:}\" ChangeSet` $nums"
done
-# send logs to CIA
+# Send logs to CIA
echo "Sending notification to CIA irc bot (cia.navi.cx)."
(
for n in $nums; do