From 8f9a80a9ac8f353ce2cdafa23f0e5163d30d5800 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 1 May 2019 22:32:11 +0300 Subject: Add support for description-type package manifest value --- libbrep/package.cxx | 2 ++ libbrep/package.hxx | 21 +++++++++++++++++++-- libbrep/package.xml | 6 ++++++ 3 files changed, 27 insertions(+), 2 deletions(-) (limited to 'libbrep') diff --git a/libbrep/package.cxx b/libbrep/package.cxx index ecd6592..a01ed14 100644 --- a/libbrep/package.cxx +++ b/libbrep/package.cxx @@ -58,6 +58,7 @@ namespace brep license_alternatives_type la, strings tg, optional ds, + optional dt, string ch, optional ur, optional du, @@ -86,6 +87,7 @@ namespace brep license_alternatives (move (la)), tags (move (tg)), description (move (ds)), + description_type (move (dt)), changes (move (ch)), url (move (ur)), doc_url (move (du)), diff --git a/libbrep/package.hxx b/libbrep/package.hxx index 2f293c1..2e31ff4 100644 --- a/libbrep/package.hxx +++ b/libbrep/package.hxx @@ -21,7 +21,7 @@ // #define LIBBREP_PACKAGE_SCHEMA_VERSION_BASE 11 -#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 11, closed) +#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 12, closed) namespace brep { @@ -45,6 +45,21 @@ namespace brep #pragma db value(priority) definition #pragma db member(priority::value) column("") + // text_type + // + using bpkg::text_type; + using bpkg::to_text_type; + + #pragma db map type(text_type) as(string) \ + to(to_string (?)) \ + from(brep::to_text_type (?)) + + using optional_text_type = optional; + + #pragma db map type(optional_text_type) as(brep::optional_string) \ + to((?) ? to_string (*(?)) : brep::optional_string ()) \ + from((?) ? brep::to_text_type (*(?)) : brep::optional_text_type ()) + // url // using bpkg::url; @@ -348,6 +363,7 @@ namespace brep license_alternatives_type, strings tags, optional description, + optional description_type, string changes, optional, optional doc_url, @@ -396,7 +412,8 @@ namespace brep string summary; license_alternatives_type license_alternatives; strings tags; - optional description; + optional description; // Absent if type is unknown. + optional description_type; // Present if description is present. string changes; optional url; optional doc_url; diff --git a/libbrep/package.xml b/libbrep/package.xml index 8ba96ec..fdb4f04 100644 --- a/libbrep/package.xml +++ b/libbrep/package.xml @@ -1,4 +1,10 @@ + + + + + + -- cgit v1.1