diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-02-09 21:40:34 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-02-10 17:25:59 +0200 |
commit | 0242fa276ae889d05f713aec4a6f09372f996a1d (patch) | |
tree | 989e29dae1c814c5f98eaa5c89f5080819a13949 | |
parent | ae301626ddd8288bd58d67dfb7b2a660740001b0 (diff) |
Support comment in the repository email manifest value
-rw-r--r-- | brep/mod-repository-details.cxx | 12 | ||||
-rw-r--r-- | brep/package | 8 | ||||
-rw-r--r-- | brep/package.xml | 3 | ||||
-rw-r--r-- | tests/load/1/stable/repositories | 2 | ||||
-rw-r--r-- | tests/load/driver.cxx | 3 |
5 files changed, 21 insertions, 7 deletions
diff --git a/brep/mod-repository-details.cxx b/brep/mod-repository-details.cxx index 7d38c6c..27493c1 100644 --- a/brep/mod-repository-details.cxx +++ b/brep/mod-repository-details.cxx @@ -109,7 +109,17 @@ handle (request& rq, response& rs) s << P_DESCRIPTION (*r.description); if (r.email) - s << P << A(HREF="mailto:" + *r.email) << *r.email << ~A << ~P; + { + const email& e (*r.email); + + s << P + << A(HREF="mailto:" + e) << e << ~A; + + if (!e.comment.empty ()) + s << " (" << e.comment << ")"; + + s << ~P; + } ostringstream o; butl::to_stream (o, diff --git a/brep/package b/brep/package index 5360623..8aa88a1 100644 --- a/brep/package +++ b/brep/package @@ -21,9 +21,9 @@ // Used by the data migration entries. // -#define LIBBREP_SCHEMA_VERSION_BASE 1 +#define LIBBREP_SCHEMA_VERSION_BASE 2 -#pragma db model version(LIBBREP_SCHEMA_VERSION_BASE, 1, closed) +#pragma db model version(LIBBREP_SCHEMA_VERSION_BASE, 2, open) // The uint16_t value range is not fully covered by SMALLINT PostgreSQL type // to which uint16_t is mapped by default. @@ -355,6 +355,8 @@ namespace brep class repository { public: + using email_type = brep::email; + // Create internal repository. // repository (repository_location, @@ -380,7 +382,7 @@ namespace brep // Present only for internal repositories. // - optional<string> email; + optional<email_type> email; optional<string> summary; optional<string> description; diff --git a/brep/package.xml b/brep/package.xml index 9c88f25..6abbf1d 100644 --- a/brep/package.xml +++ b/brep/package.xml @@ -1,5 +1,5 @@ <changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" database="pgsql" version="1"> - <model version="1"> + <model version="2"> <table name="repository" kind="object"> <column name="name" type="TEXT" null="false"/> <column name="location" type="TEXT" null="false"/> @@ -7,6 +7,7 @@ <column name="priority" type="INTEGER" null="false"/> <column name="url" type="TEXT" null="true"/> <column name="email" type="TEXT" null="true"/> + <column name="email_comment" type="TEXT" null="true"/> <column name="summary" type="TEXT" null="true"/> <column name="description" type="TEXT" null="true"/> <column name="local_path" type="TEXT" null="false"/> diff --git a/tests/load/1/stable/repositories b/tests/load/1/stable/repositories index b692ebe..815a1b5 100644 --- a/tests/load/1/stable/repositories +++ b/tests/load/1/stable/repositories @@ -9,6 +9,6 @@ location: ../math : # Local repository manifest (this repository). # -email: repoman@cppget.org +email: repoman@cppget.org; public mailing list summary: General C++ package stable repository description: This is the awesome C++ package repository full of exciting stuff. diff --git a/tests/load/driver.cxx b/tests/load/driver.cxx index 539c50d..41e4623 100644 --- a/tests/load/driver.cxx +++ b/tests/load/driver.cxx @@ -107,7 +107,8 @@ main (int argc, char* argv[]) assert (sr->display_name == "stable"); assert (sr->priority == 1); assert (!sr->url); - assert (sr->email && *sr->email == "repoman@cppget.org"); + assert (sr->email && *sr->email == "repoman@cppget.org" && + sr->email->comment == "public mailing list"); assert (sr->summary && *sr->summary == "General C++ package stable repository"); assert (sr->description && *sr->description == |