From: Ian Jackson Subject: [OSSTEST PATCH 1/8] emails: cr*: Defer setting of OSSTEST_EMAIL_HEADER Date: Wed, 25 Feb 2015 13:01:10 +0000 Message-ID: <1424869277-16764-2-git-send-email-ian.jackson@eu.citrix.com> References: <1424869277-16764-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YQbbP-0004Dx-HD for xen-devel@lists.xenproject.org; Wed, 25 Feb 2015 13:02:11 +0000 In-Reply-To: <1424869277-16764-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org Defer computing this variable until it is going to be used. The effect is that the fallback default value is assigned much later - in start_email (cr-daily-branch) or send_bisection_email (cri-bisect). Previously it was assigned as soon as cri-args-hostlists was read, which is quite early. In the next patch this will allow other hooks (eg the branch settings) to adjust the default, rather than them having to override. Signed-off-by: Ian Jackson --- cri-args-hostlists | 6 +++++- cri-bisect | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cri-args-hostlists b/cri-args-hostlists index 57958d3..3e5ef44 100644 --- a/cri-args-hostlists +++ b/cri-args-hostlists @@ -53,7 +53,9 @@ elif [ "x$1" = "x--like-real" ]; then fi : ${OSSTEST_BLESSING:=play} -: ${OSSTEST_EMAIL_HEADER:=daily-cron-email-$OSSTEST_BLESSING} +prepare_for_email () { + : ${OSSTEST_EMAIL_HEADER:=daily-cron-email-$OSSTEST_BLESSING} +} . ${OSSTEST_CRON_SETTINGS:-$dcs-$OSSTEST_BLESSING} @@ -93,6 +95,8 @@ start_email () { local subject_prefix=$4 # redirects stdout + prepare_for_email + exec >tmp/$flight.email branchemailheader=$OSSTEST_EMAIL_HEADER--$branch if test -e $branchemailheader; then diff --git a/cri-bisect b/cri-bisect index af3f23f..e7ed24b 100644 --- a/cri-bisect +++ b/cri-bisect @@ -84,6 +84,8 @@ perhaps_bisect_step_core () { send_bisection_email () { echo emailing "$2" "$1" + prepare_for_email + exec 3>tmp/$flight.email cat >&3 $OSSTEST_EMAIL_HEADER$2 cat >&3 <