From 3f2e2bf09ceb5490d3ffc697d1bba1d0df20cd68 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 7 Aug 2010 11:06:22 +0000 Subject: [PATCH] Added command-line option -r, which allows to specify an alternative recipient e-mail address. Convenient for having output of testruns sent to an alternative e-mail address. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1942 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- nightly/bin/nightly | 19 ++++++++++++++++++- nightly/conf/cellbuzz.sendmail | 18 ++++++++++++++++-- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/nightly/bin/nightly b/nightly/bin/nightly index 0c9436f02..f38f3da40 100755 --- a/nightly/bin/nightly +++ b/nightly/bin/nightly @@ -41,15 +41,31 @@ runcmd () { return $res } +usage () { + echo "usage: $0 [-r ] " +} + #---------------------------------------------------------------------------- # Startup #---------------------------------------------------------------------------- scst_svn_repo="https://scst.svn.sourceforge.net/svnroot/scst/trunk" +sendmail_opts="" + +set -- $(/usr/bin/getopt "r:" "$@") +while [ "$1" != "${1#-}" ] +do + case "$1" in + '-h') usage; exit 1;; + '-r') sendmail_opts="$1 $2"; shift; shift;; + '--') shift;; + *) usage; exit 1;; + esac +done # Must have exactly one argument if [ "$#" -ne 1 ] ; then - echo "usage: $0 " + usage exit 1 fi @@ -183,5 +199,6 @@ fi # Use the conf/.sendmail script to email the results. conf/$ABT_MACHINE.sendmail \ + ${sendmail_opts} \ "$changed_str$ABT_START nightly build ($ABT_MACHINE, $ABT_DETAILS)" \ final > sendmail.log 2>&1 diff --git a/nightly/conf/cellbuzz.sendmail b/nightly/conf/cellbuzz.sendmail index c9ce53545..1dbebb0ba 100755 --- a/nightly/conf/cellbuzz.sendmail +++ b/nightly/conf/cellbuzz.sendmail @@ -1,10 +1,24 @@ #!/bin/sh -# usage: $0 subject file-to-mail [file-to-attach] # Don't forget to set the variables 'from' and 'realname' in ~/.muttrc !! +usage() { + echo "Usage: $0 [-r ] []" +} + recipients="scst-devel@lists.sourceforge.net" -#recipients="bart.vanassche@gmail.com" + +set -- $(/usr/bin/getopt "r:" "$@") +while [ "$1" != "${1#-}" ] +do + case "$1" in + '-r') recipients="$2"; shift; shift;; + '-h') usage; exit 1;; + '--') shift;; + *) usage; exit 1;; + esac +done + if [ $# -ge 3 ]; then gzip -9 <"$3" >"$3.gz" mutt -s "$1" -a "$3.gz" ${recipients} < "$2"