From bdebb3c30ecfbce561a572ad6a8dfce281c322e1 Mon Sep 17 00:00:00 2001 From: Nic Boet Date: Mon, 27 Feb 2023 00:27:02 +0100 Subject: [PATCH] Improve send_mail() because it acts more like the logger MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * output failure events to stdout if verbose set, useful for those without a mailer * do not email if recipient var is undef; allows flexibility for non-releng use cases Signed-off-by: Nic Boet Signed-off-by: Andreas K. Hüttel --- tools/catalyst-auto | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/catalyst-auto b/tools/catalyst-auto index 1780daf4..c6b303f5 100755 --- a/tools/catalyst-auto +++ b/tools/catalyst-auto @@ -53,8 +53,14 @@ EOH } send_email() { + if [[ ${verbose} -ge 1 ]]; then + echo "$1 $2 build log at $3" + fi + [[ ${nonetwork} == 0 ]] || return + [[ ! -z ${EMAIL_TO} ]] || return + local subject="${EMAIL_SUBJECT_PREPEND} $1" local message=$2 local logfile=$3