From 1e3c3def7cf41be5ca10ab3881de1fa180e55cb2 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Sun, 8 Feb 2015 03:49:33 -0500 Subject: [PATCH] Fixing mistakes from last attempt. Things should be OK now. --- master.cfg | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/master.cfg b/master.cfg index 15f6872..9479a5c 100644 --- a/master.cfg +++ b/master.cfg @@ -139,15 +139,17 @@ import smtplib import socket from email.mime.text import MIMEText -def SendRootMessageGDBTesters (branch, rev, change): +def SendRootMessageGDBTesters (branch, change): global GDB_MAIL_TO, GDB_MAIL_FROM + rev = change.revision f = "/tmp/gdb-buildbot-%s.lock" % rev if os.path.exists (f): # The message has already been sent return - open ("/tmp/%s" % rev, 'w').close () + # WE HAVE TO REMEMBER TO CLEAN THESE FILES REGULARLY + open (f, 'w').close () text = "" text += "*** TEST RESULTS FOR COMMIT %s ***\n\n" % rev @@ -156,13 +158,15 @@ def SendRootMessageGDBTesters (branch, rev, change): text += "Branch: %s\n" % branch text += "Commit: %s\n\n" % rev - text += change.comments + "\n" + text += change.comments + "\n\n" + + text += change.patch + "\n" mail = MIMEText (text) mail['Subject'] = "Test results for commit %s on branch %s" % (rev, branch) mail['From'] = GDB_MAIL_FROM mail['To'] = GDB_MAIL_TO - mail['Message-Id'] = "%s@%s" (rev, socket.gethostname ()) + mail['Message-Id'] = "<%s@%s>" % (rev, socket.gethostname ()) s = smtplib.SMTP ('localhost') s.sendmail (GDB_MAIL_FROM, [ GDB_MAIL_TO ], mail.as_string ()) @@ -173,9 +177,10 @@ def MessageGDBTesters (mode, name, build, results, master_status): send to the gdb-testers mailing list.""" git_url = "http://gdb-build.sergiodj.net/cgit" branch = build.getSourceStamps ()[0].branch + cur_change = build.getSourceStamps ()[0].changes[0] # Sending the root message to gdb-testers. - SendRootMessageGDBTesters (branch, name, ss_list[0].changes[0]) + SendRootMessageGDBTesters (branch, cur_change) # Subject subj = "Failures on %s, branch %s" % (name, branch) @@ -286,7 +291,8 @@ mn = mail.MailNotifier(fromaddr = GDB_MAIL_FROM, mode = ('failing'), messageFormatter = MessageGDBTesters, extraHeaders = { 'X-GDB-Buildbot' : '1', - 'In-Reply-To' : WithProperties ("%(got_revision)s@%s" % socket.gethostname ()) }) + 'In-Reply-To' : WithProperties ("<%s@" + socket.gethostname () + ">", + 'got_revision') }) c['status'].append (mn)