blob: a75be349ae31003609f3bd9a8944b9096d1fb8b6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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/\&/\&/g;s/</\</g;s/>/\>/g'`
module=`basename $BKD_ROOT | sed 's/\&/\&/g;s/</\</g;s/>/\>/g'`
log=`bk changes -r"$REV" -d":C:" | sed 's/\&/\&/g;s/</\</g;s/>/\>/g'`
tag=`bk changes -r"$REV" -d":TAG:" | sed 's/\&/\&/g;s/</\</g;s/>/\>/g'`
files=`bk changes -n -v -r"$REV" -d"\\\$unless(:GFILE:=ChangeSet){:GFILE:}" | sort -u | sed 's/\&/\&/g;s/</\</g;s/>/\>/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 ###
|