summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortip email robot <tipbot@terminus.zytor.com>2011-11-19 00:30:15 (GMT)
committertip email robot <tipbot@terminus.zytor.com>2011-11-19 00:30:15 (GMT)
commit479f3e3d80360973734903afe657a40785812a96 (patch)
tree161bb1c2d8f962582fb61347bc7d6c5f36cf208e
parentd8c325290903db706d3b9053e938ddda397202cb (diff)
downloadtip-bot-479f3e3d80360973734903afe657a40785812a96.zip
tip-bot-479f3e3d80360973734903afe657a40785812a96.tar.gz
tip-bot-479f3e3d80360973734903afe657a40785812a96.tar.bz2
tip-bot-479f3e3d80360973734903afe657a40785812a96.tar.xz
Changes to port tip-bot to zytor.com
-rwxr-xr-xrobot-wrapper.sh2
-rwxr-xr-xrobot.sh23
-rwxr-xr-xrobotfmt.pl7
3 files changed, 20 insertions, 12 deletions
diff --git a/robot-wrapper.sh b/robot-wrapper.sh
index 00183cd..574ce31 100755
--- a/robot-wrapper.sh
+++ b/robot-wrapper.sh
@@ -1,3 +1,3 @@
#!/bin/sh
-cd /home/hpa/tip
+cd "$HOME"/tip
exec ./robot.sh > log/`date +%Y%m%d.%H%M.log` 2>&1
diff --git a/robot.sh b/robot.sh
index 2e0ac35..be08954 100755
--- a/robot.sh
+++ b/robot.sh
@@ -2,8 +2,7 @@
#MAILTO='tip commits list <linux-tip-commits@vger.kernel.org>'
MAILTO='linux-tip-commits@vger.kernel.org'
-SENDER='hpa@kernel.org'
-MASTER='/pub/scm/linux/kernel/git/x86/linux-2.6-tip.git'
+SENDER='tipbot@zytor.com'
# /usr/sbin needed for sendmail
export PATH=/bin:/usr/bin:/usr/local/bin:/usr/sbin:$HOME/bin
@@ -11,9 +10,12 @@ export PATH=/bin:/usr/bin:/usr/local/bin:/usr/sbin:$HOME/bin
topdir="$HOME/tip"
tmpdir="/tmp/$USER/tipmail"
-slave="$HOME/tip/tip.git"
+master="$topdir/mirrors/tip"
+slave="$topdir/tip.git"
date=$(date -uR)
+max_mails=100
+
(
flock -nx 8 || exit 0
@@ -23,15 +25,19 @@ date=$(date -uR)
exit 0
fi
+ for m in linus tip; do
+ GIT_DIR="$topdir/mirrors/$m" git fetch || exit 0
+ done
+
mkdir -m 0700 -p $tmpdir
rm -rf .tip
- GIT_DIR="$MASTER" git archive --format=tar tip .tip/auto-branches | tar xf -
+ GIT_DIR="$master" git archive --format=tar tip .tip/auto-branches | tar xf -
cat .tip/auto-branches/* "$topdir"/extra-branches | \
"$topdir"/filter-branches.pl | sort | uniq > branches
(
while read branch; do
- GIT_DIR="$MASTER" git rev-parse "$branch"'^{}'
+ GIT_DIR="$master" git rev-parse --revs-only "$branch"'^{}'
done
) < branches > branches.heads
sha1sum branches.heads > branches.id.new
@@ -52,15 +58,16 @@ date=$(date -uR)
if [ x"$NEW_HEAD" != x"$OLD_HEAD" ]; then
git rev-list --reverse --no-merges ^linus/master $baselines ^$OLD_HEAD $NEW_HEAD > "$tmpdir"/revlist.$$
count=$(wc -l < "$tmpdir"/revlist.$$)
- if [ $count -gt 100 ]; then
+ if [ $count -gt $max_mails ]; then
# Failsafe!
git reset --hard $OLD_HEAD
- cat > "$tmpdir"/failsafe.$$ <<EOF
-From: tip-bot alert <hpa@git.kernel.org>
+ cat - "$tmpdir"/revlist.$$ > "$tmpdir"/failsafe.$$ <<EOF
+From: tip-bot alert <$SENDER>
To: H. Peter Anvin <hpa@zytor.com>
Subject: tip-bot failsafe: $count emails
Trying to send $count emails, reverting to $OLD_HEAD
+
EOF
sendmail -i -t < "$tmpdir"/failsafe.$$
rm -f "$tmpdir"/failsafe.$$
diff --git a/robotfmt.pl b/robotfmt.pl
index c7a0bd1..747b748 100755
--- a/robotfmt.pl
+++ b/robotfmt.pl
@@ -57,7 +57,7 @@ sub best_branch($$) {
$branch = best_branch($rev, $branches);
-$sender = 'bounces.tip@hpa.at.zytor.com';
+$sender = 'tipbot@zytor.com';
$format = <<EOF;
Sender: tip tree robot <${sender}>
@@ -94,7 +94,7 @@ $format =~ s/\%b\%n/\%b/; # Remove newline after %b
'hpa@zytor.com' => 1);
@blacklist = ();
$lkml = 'linux-kernel@vger.kernel.org';
-# $lkml = 'hpa+tiptest@zytor.com';
+#$test_only = 'hpa+tiptest@zytor.com';
# Form used for inital-submission emails
$nullref = '<tip-*@git.kernel.org>';
@@ -164,6 +164,7 @@ if (scalar(@references)) {
}
splice(@message, 2, 0, @moreheaders);
-open(SENDMAIL, "|-", "sendmail -f \Q$sender\E -i -t -O DeliveryMode=b") or die;
+$target = $test_only ? "\Q$test_only" : '-t';
+open(SENDMAIL, "|-", "sendmail -f \Q$sender\E -i -O DeliveryMode=b $target") or die;
print SENDMAIL @message;
close(SENDMAIL);