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 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'bpkg') 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) -- cgit v1.1