aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/mod-build-result.cxx11
-rw-r--r--mod/module.cli14
2 files changed, 25 insertions, 0 deletions
diff --git a/mod/mod-build-result.cxx b/mod/mod-build-result.cxx
index 1445a1d..a55b41f 100644
--- a/mod/mod-build-result.cxx
+++ b/mod/mod-build-result.cxx
@@ -525,6 +525,17 @@ handle (request& rq, response&)
if (bld == nullptr)
return true;
+ // Bail out if sending build notification emails is disabled for this
+ // toolchain.
+ //
+ {
+ const map<string, bool>& tes (options_->build_toolchain_email ());
+
+ auto i (tes.find (bld->id.toolchain_name));
+ if (i != tes.end () && !i->second)
+ return true;
+ }
+
string subj ((unforced ? "build " : "rebuild ") +
to_string (*bld->status) + ": " +
bld->package_name.string () + '/' +
diff --git a/mod/module.cli b/mod/module.cli
index c2dce5b..bd61873 100644
--- a/mod/module.cli
+++ b/mod/module.cli
@@ -1,6 +1,7 @@
// file : mod/options.cli -*- C++ -*-
// license : MIT; see accompanying LICENSE file
+include <map>;
include <regex>;
include <libbpkg/manifest.hxx>; // repository_location
@@ -463,6 +464,19 @@ namespace brep
face of recoverable failures (deadlock, loss of connection, etc). The
default is 10M."
}
+
+ std::map<string, bool> build-toolchain-email
+ {
+ "<name>=<bool>",
+ "Enable or disable package build notification emails. If \cb{true} is
+ specified for a toolchain name, then emails are sent according to the
+ \cb{build-*email} package manifest values when the package is built
+ with this toolchain. If \cb{false} is specified, then no emails are
+ sent for this toolchain name. By default build notification emails
+ are enabled. Repeat this option to enable/disable emails for multiple
+ toolchains. See \l{bpkg#manifest-package Package Manifest} for
+ details on \cb{build-*email} values."
+ }
};
class build_log: build, build_db, handler