Attempt to make the triggers a bit smarter.
authorChris Larson <clarson@kergoth.com>
Thu, 23 Sep 2004 17:22:17 +0000 (17:22 +0000)
committerChris Larson <clarson@kergoth.com>
Thu, 23 Sep 2004 17:22:17 +0000 (17:22 +0000)
BKrev: 4153064992Y5nU0T9yK2OehUxnpo6Q

BitKeeper/triggers/ciabot.projects [new file with mode: 0644]
BitKeeper/triggers/ciabot_bk.sh
BitKeeper/triggers/post-outgoing.ciabot

diff --git a/BitKeeper/triggers/ciabot.projects b/BitKeeper/triggers/ciabot.projects
new file mode 100644 (file)
index 0000000..e69de29
index aa61599..b757b49 100644 (file)
@@ -11,8 +11,8 @@
 ############# There are some parameters for this script that you can customize:
 
 # Project information
-project_name="openembedded"
-return_address="oe@handhelds.org"
+[ -z "$project_name" ] && project_name="openembedded"
+[ -z "$project_name" ] && return_address="oe@handhelds.org"
 
 # System
 sendmail_command="/usr/sbin/sendmail -t"
index 25c2284..3944b23 100644 (file)
@@ -1,5 +1,8 @@
 #!/bin/sh
-
+#
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
 # Copyright (C) 2004 Chris Larson <kergoth@handhelds.org>
 #
 # Sanity checks taken from the scripts on commits.bkbits.net
@@ -39,9 +42,28 @@ check_sanity () {
     fi
 }
 
+check_projects () {
+    if [ ! -e ciabot.projects ]; then
+        return 1
+    fi
+
+    while read _p _s _e; do
+        _sshort=`echo $_s|sed -e's,.bkbits.net,,'`
+        if (echo $BKD_ROOT|grep "/${_sshort}"); then
+            project_name=${_p}
+            return_address=${_e}
+        fi
+    done < ciabot.projects
+    export project_name return_address
+    return 0
+}
+
 # Check sanity - do we need to send anything?
 check_sanity || exit 0
 
+# Check projects - attempt to determine which bkbits project we are
+check_projects || exit 0
+
 if (grep -q 'ChangeSet' $BK_CSETLIST); then
     # new, correct csets-out format
     nums=`bk changes -d":REV: " - < $BK_CSETLIST`