aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-05-19 20:45:41 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-05-19 20:45:41 +0300
commit0035543c17c070077ec4c62174e5c6f8024c8a6b (patch)
tree8f3be9bd2dcb8be2556a7550e247ea7514a614da
parentc51ccc69ed4039fac8ebfbd7c2fcaf0abb8341d0 (diff)
Add force flag to build notification email
-rw-r--r--mod/mod-build-result.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/mod/mod-build-result.cxx b/mod/mod-build-result.cxx
index f2b4ffd..ae6c5b1 100644
--- a/mod/mod-build-result.cxx
+++ b/mod/mod-build-result.cxx
@@ -231,6 +231,7 @@ handle (request& rq, response&)
shared_ptr<build> b;
optional<result_status> prev_status;
bool notify (false);
+ bool unforced (true);
{
transaction t (build_db_->begin ());
@@ -244,12 +245,13 @@ handle (request& rq, response&)
warn_expired ("non-matching timestamp");
else
{
+ unforced = b->force == force_state::unforced;
+
// Don's send email for the success-to-success status change, unless the
// build was forced.
//
notify = !(rqm.result.status == result_status::success &&
- b->status && *b->status == rqm.result.status &&
- b->force == force_state::unforced);
+ b->status && *b->status == rqm.result.status && unforced);
prev_status = move (b->status);
@@ -283,7 +285,8 @@ handle (request& rq, response&)
//
try
{
- string subj (to_string (*b->status) + ": " + b->package_name + '/' +
+ string subj ((unforced ? "build " : "rebuild ") +
+ to_string (*b->status) + ": " + b->package_name + '/' +
b->package_version.string () + '/' + b->configuration + '/' +
b->toolchain_name + '-' + b->toolchain_version.string ());