commit:     bdebb3c30ecfbce561a572ad6a8dfce281c322e1
Author:     Nic Boet <nic <AT> boet <DOT> cc>
AuthorDate: Sun Feb 26 23:27:02 2023 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sun Feb 26 23:27:02 2023 +0000
URL:        https://gitweb.gentoo.org/proj/releng.git/commit/?id=bdebb3c3

Improve send_mail() because it acts more like the logger

 * 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 <nic <AT> boet.cc>
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>

 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

Reply via email to