From 3dd770d5ab887538adbb6df49bc9c7fa5d1a1855 Mon Sep 17 00:00:00 2001 From: spoon Date: Fri, 17 Feb 2006 19:59:32 +0000 Subject: [PATCH] support emailing the report to multiple addresses git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@5792 5e8d7ff9-d8ef-0310-90f0-a4852d11357a --- test/scala2-nightly-test.scm | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/test/scala2-nightly-test.scm b/test/scala2-nightly-test.scm index 626b25177..116711d3f 100755 --- a/test/scala2-nightly-test.scm +++ b/test/scala2-nightly-test.scm @@ -17,17 +17,23 @@ exec scsh -e main -s "$0" "$@" (define scala-svn-module-name "scala") ;; E-mail address to which the failure notification should be sent. -(define notify-email "scala-devel@groupes.epfl.ch") -;;(define notify-email "stephane.micheloud@epfl.ch") ; DEBUG -;;(define notify-email "lex.spoon@epfl.ch") ; DEBUG +(define notify-emails '("scala-devel@groupes.epfl.ch")) +;;(define notify-emails '("stephane.micheloud@epfl.ch")) ; DEBUG + ;; Directory in which the distribution should be built. -(define nightly-build-dir -;; (expand-file-name "~lex/scala/nightly-scala2")) ; DEBUG - (expand-file-name "~linuxsoft/archives/scala/nightly-scala2")) +;(define nightly-build-dir +; (expand-file-name "~linuxsoft/archives/scala/nightly-scala2")) ;; End of configuration section. +(define (flatten-with-commas lst) + (cond + ((null? lst) "") + (#t (fold (lambda (s accum) (string-append accum ", " s)) + (car lst) + (cdr lst))))) + (define (main cmd-line) (let ((prog (car cmd-line)) (args (cdr cmd-line))) @@ -94,10 +100,10 @@ exec scsh -e main -s "$0" "$@" (define (send-warning-mail log-file-name link-name) (send-mail - notify-email + notify-emails `(("Subject" . "Failure of nightly Scala 2 test") - ("To" . ,notify-email) - ("Reply-To" . ,notify-email)) + ("To" . ,(flatten-with-commas notify-emails)) + ("Reply-To" . ,(car notify-emails))) (string-append "Tonight's automatic Scala test failed. More details can be found\n" "in file "log-file-name"\n" @@ -116,7 +122,7 @@ exec scsh -e main -s "$0" "$@" (newline mail-port) (write-string body mail-port) (newline mail-port) - (run (sendmail "-i" ,to) + (run (sendmail "-i" ,@to) (<< ,(string-output-port-output mail-port))))) ;;; Local Variables: