From 003a4d697b9944602418fca8c82fa244433512ea Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 9 Feb 2016 21:40:03 +0200 Subject: Support comment in the repository email manifest value --- bpkg/manifest | 4 +++- bpkg/manifest.cxx | 6 ++++-- tests/manifest/repositories | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bpkg/manifest b/bpkg/manifest index 6e42085..29ba6fe 100644 --- a/bpkg/manifest +++ b/bpkg/manifest @@ -523,13 +523,15 @@ namespace bpkg class repository_manifest { public: + using email_type = bpkg::email; + repository_location location; butl::optional role; // The following values may only be present for the base repository. // butl::optional url; - butl::optional email; + butl::optional email; butl::optional summary; butl::optional description; diff --git a/bpkg/manifest.cxx b/bpkg/manifest.cxx index 0923a48..2cad721 100644 --- a/bpkg/manifest.cxx +++ b/bpkg/manifest.cxx @@ -1735,10 +1735,12 @@ namespace bpkg if (email) bad_name ("email redefinition"); + string c (split_comment (v)); + if (v.empty ()) bad_value ("empty email"); - email = move (v); + email = email_type (move (v), move (c)); } else if (n == "summary") { @@ -1824,7 +1826,7 @@ namespace bpkg if (!b) bad_value ("email not allowed"); - s.next ("email", *email); + s.next ("email", add_comment (*email, email->comment)); } if (summary) diff --git a/tests/manifest/repositories b/tests/manifest/repositories index 8d67635..bae9c86 100644 --- a/tests/manifest/repositories +++ b/tests/manifest/repositories @@ -6,7 +6,7 @@ location: ../stable role: complement : url: http://cppget.org -email: repoman@cppget.org +email: repoman@cppget.org; General mailing list. summary: General C++ package repository description: This is the awesome C++ package repository full of exciting\ stuff. -- cgit v1.1