aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--brep/package6
-rw-r--r--brep/package.cxx2
-rw-r--r--brep/package.xml4
-rw-r--r--load/load.cxx1
-rw-r--r--mod/mod-build-result.cxx18
5 files changed, 22 insertions, 9 deletions
diff --git a/brep/package b/brep/package
index d50aa9f..ba7490f 100644
--- a/brep/package
+++ b/brep/package
@@ -18,9 +18,9 @@
// Used by the data migration entries.
//
-#define LIBBREP_PACKAGE_SCHEMA_VERSION_BASE 3
+#define LIBBREP_PACKAGE_SCHEMA_VERSION_BASE 4
-#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 3, closed)
+#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 4, open)
namespace brep
{
@@ -306,6 +306,7 @@ namespace brep
optional<url_type> package_url,
email_type,
optional<email_type> package_email,
+ optional<email_type> build_email,
dependencies_type,
requirements_type,
optional<path> location,
@@ -338,6 +339,7 @@ namespace brep
optional<url_type> package_url;
email_type email;
optional<email_type> package_email;
+ optional<email_type> build_email;
dependencies_type dependencies;
requirements_type requirements;
lazy_shared_ptr<repository_type> internal_repository;
diff --git a/brep/package.cxx b/brep/package.cxx
index eaf1029..144fc05 100644
--- a/brep/package.cxx
+++ b/brep/package.cxx
@@ -59,6 +59,7 @@ namespace brep
optional<url_type> pu,
email_type em,
optional<email_type> pe,
+ optional<email_type> be,
dependencies_type dp,
requirements_type rq,
optional<path> lc,
@@ -76,6 +77,7 @@ namespace brep
package_url (move (pu)),
email (move (em)),
package_email (move (pe)),
+ build_email (move (be)),
dependencies (move (dp)),
requirements (move (rq)),
internal_repository (move (rp)),
diff --git a/brep/package.xml b/brep/package.xml
index 39494ce..657c2fc 100644
--- a/brep/package.xml
+++ b/brep/package.xml
@@ -1,5 +1,5 @@
<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" database="pgsql" schema-name="package" version="1">
- <model version="3">
+ <model version="4">
<table name="repository" kind="object">
<column name="name" type="TEXT" null="false"/>
<column name="location" type="TEXT" null="false"/>
@@ -90,6 +90,8 @@
<column name="email_comment" type="TEXT" null="false"/>
<column name="package_email" type="TEXT" null="true"/>
<column name="package_email_comment" type="TEXT" null="true"/>
+ <column name="build_email" type="TEXT" null="true"/>
+ <column name="build_email_comment" type="TEXT" null="true"/>
<column name="internal_repository" type="TEXT" null="true"/>
<column name="location" type="TEXT" null="true"/>
<column name="sha256sum" type="TEXT" null="true"/>
diff --git a/load/load.cxx b/load/load.cxx
index e611df2..eabe547 100644
--- a/load/load.cxx
+++ b/load/load.cxx
@@ -411,6 +411,7 @@ load_packages (const shared_ptr<repository>& rp, database& db)
move (pm.package_url),
move (pm.email),
move (pm.package_email),
+ move (pm.build_email),
move (ds),
move (pm.requirements),
move (pm.location),
diff --git a/mod/mod-build-result.cxx b/mod/mod-build-result.cxx
index 917a6d0..1531183 100644
--- a/mod/mod-build-result.cxx
+++ b/mod/mod-build-result.cxx
@@ -262,7 +262,11 @@ handle (request& rq, response&)
t.commit ();
}
- if (!notify)
+ // Don't send the notification email if the empty package build email is
+ // specified.
+ //
+ const optional<email>& build_email (p->build_email);
+ if (!notify || (build_email && build_email->empty ()))
return true;
assert (b != nullptr);
@@ -284,12 +288,14 @@ handle (request& rq, response&)
subj += " after " + to_string (*prev_status);
}
- // If the package email address is not specified, then it is assumed to be
- // the same as the project email address.
+ // If the package build address is not specified, then it is assumed to be
+ // the same as the package email address, if specified, otherwise as the
+ // project email address.
//
- const string& to (p->package_email
- ? *p->package_email
- : p->email);
+ const string& to (build_email ? *build_email
+ : p->package_email
+ ? *p->package_email
+ : p->email);
auto print_args = [&trace, this] (const char* args[], size_t n)
{