summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2012-09-27 04:13:18 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2012-09-27 04:13:18 (GMT)
commitc9509977d547f080965d36b52bc0698de4930d4f (patch)
tree5559b21863a8a285c523d1478e68a1e2834998b8
parentee7708354bb0a068fd7c891fcbd8cbd8873b4643 (diff)
downloadtip-bot-c9509977d547f080965d36b52bc0698de4930d4f.zip
tip-bot-c9509977d547f080965d36b52bc0698de4930d4f.tar.gz
tip-bot-c9509977d547f080965d36b52bc0698de4930d4f.tar.bz2
tip-bot-c9509977d547f080965d36b52bc0698de4930d4f.tar.xz
Each commit gets a new ID, so do a hash of the failsafe list
-rwxr-xr-xrobot.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/robot.sh b/robot.sh
index 87d5ffa..a605f25 100755
--- a/robot.sh
+++ b/robot.sh
@@ -60,10 +60,11 @@ max_mails=100
count=$(wc -l < "$tmpdir"/revlist.$$)
if [ $count -gt $max_mails ]; then
# Failsafe!
+ LIST_HASH=$(sha256sum < "$tmpdir"/revlist.$$ | awk '{ print $1; }')
git reset --hard $OLD_HEAD
LAST_FAILSAFE=$(cat "$topdir"/last_failsafe 2>/dev/null || true)
- if [ x"$NEW_HEAD" != x"$LAST_FAILSAFE" ]; then
- echo "$NEW_HEAD" > "$topdir"/last_failsafe
+ if [ x"$LIST_HASH" != x"$LAST_FAILSAFE" ]; then
+ echo "$LIST_HASH" > "$topdir"/last_failsafe
# A mostly arbitrary string as long as it doesn't occur anywhere...
boundary='----------73zc71qfWjUfy1i6'
cat > "$tmpdir"/failsafe.$$ <<EOF