summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2012-08-21 16:54:12 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2012-08-21 16:54:12 (GMT)
commit021ea3e951aafe189e8a8c466624cb95b324de07 (patch)
treed99f0bf54f1d5cefbe8dea3376cc6b520104ed20
parentf516810d3af5bfb22eb7e18e72ec2354b74b6c5f (diff)
downloadtip-bot-021ea3e951aafe189e8a8c466624cb95b324de07.zip
tip-bot-021ea3e951aafe189e8a8c466624cb95b324de07.tar.gz
tip-bot-021ea3e951aafe189e8a8c466624cb95b324de07.tar.bz2
tip-bot-021ea3e951aafe189e8a8c466624cb95b324de07.tar.xz
robot.sh: only send one failsafe mail per HEAD; send to all tipsters
Send only a single failsafe mail per new HEAD, and send it to the entire -tip team.
-rwxr-xr-xrobot.sh22
1 files changed, 13 insertions, 9 deletions
diff --git a/robot.sh b/robot.sh
index a13e8b4..123cda6 100755
--- a/robot.sh
+++ b/robot.sh
@@ -61,9 +61,12 @@ max_mails=100
if [ $count -gt $max_mails ]; then
# Failsafe!
git reset --hard $OLD_HEAD
- cat > "$tmpdir"/failsafe.$$ <<EOF
+ LAST_FAILSAFE=$(cat "$topdir"/last_failsafe)
+ if [ x"$NEW_HEAD" != x"$LAST_FAILSAFE" ]; then
+ echo "$NEW_HEAD" > "$topdir"/last_failsafe
+ cat > "$tmpdir"/failsafe.$$ <<EOF
From: tip-bot alert <$SENDER>
-To: H. Peter Anvin <hpa@zytor.com>
+To: H. Peter Anvin <hpa@zytor.com>, Ingo Molnar <mingo@kernel.org>, Thomas Gleixner <tglx@linutronix.de>
Subject: tip-bot failsafe: $count emails
User-Agent: tip-bot failsafe
MIME-Version: 1.0
@@ -76,21 +79,22 @@ Content-Transfer-Encoding: 8bit
Trying to send $count emails, reverting to $OLD_HEAD
EOF
- git shortlog --no-walk --format='%h %s' `cat "$tmpdir"/revlist.$$` \
- >> "$tmpdir"/failsafe.$$
- cat >> "$tmpdir"/failsafe.$$ <<EOF
+ git shortlog --no-walk --format='%h %s' `cat "$tmpdir"/revlist.$$` \
+ >> "$tmpdir"/failsafe.$$
+ cat >> "$tmpdir"/failsafe.$$ <<EOF
------------73zc71qfWjUfy1i6
Content-Type: text/plain; charset=UTF-8; name="commit.lst"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="commit.lst"
EOF
- cat "$tmpdir"/revlist.$$ >> "$tmpdir"/failsafe.$$
- cat >> "$tmpdir"/failsafe.$$ <<EOF
+ cat "$tmpdir"/revlist.$$ >> "$tmpdir"/failsafe.$$
+ cat >> "$tmpdir"/failsafe.$$ <<EOF
------------73zc71qfWjUfy1i6--
EOF
- sendmail -i -t < "$tmpdir"/failsafe.$$
- rm -f "$tmpdir"/failsafe.$$
+ sendmail -i -t < "$tmpdir"/failsafe.$$
+ rm -f "$tmpdir"/failsafe.$$
+ fi
exit 1
fi
(