From 0242fa276ae889d05f713aec4a6f09372f996a1d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 9 Feb 2016 21:40:34 +0200 Subject: Support comment in the repository email manifest value --- brep/mod-repository-details.cxx | 12 +++++++++++- brep/package | 8 +++++--- brep/package.xml | 3 ++- tests/load/1/stable/repositories | 2 +- 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 email; + optional email; optional summary; optional 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 @@ - + @@ -7,6 +7,7 @@ + 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 == -- cgit v1.1