aboutsummaryrefslogtreecommitdiff
path: root/bpkg/types-parsers.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-10-06 22:16:46 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-10-07 13:20:53 +0300
commite253cd97c6a8d55a5be19731d58769f4663ab2d1 (patch)
tree44a976e7b4ac4d55212cd0b7f2c52a5bf18d8516 /bpkg/types-parsers.cxx
parented3452457b33bb7a4b2f0abb3ae1fc53f826bc9e (diff)
Add support for applying backward compatibility workarounds to packages.manifest file generated by rep-create
Diffstat (limited to 'bpkg/types-parsers.cxx')
-rw-r--r--bpkg/types-parsers.cxx29
1 files changed, 29 insertions, 0 deletions
diff --git a/bpkg/types-parsers.cxx b/bpkg/types-parsers.cxx
index d5ddb28..97ebafe 100644
--- a/bpkg/types-parsers.cxx
+++ b/bpkg/types-parsers.cxx
@@ -92,6 +92,35 @@ namespace bpkg
}
}
+ void parser<butl::standard_version>::
+ parse (butl::standard_version& x, bool& xs, scanner& s)
+ {
+ using butl::standard_version;
+
+ xs = true;
+
+ const char* o (s.next ());
+
+ if (!s.more ())
+ throw missing_value (o);
+
+ const char* v (s.next ());
+
+ try
+ {
+ // Note that we allow all kinds of versions, so that the caller can
+ // restrict them as they wish after the parsing.
+ //
+ x = standard_version (v,
+ standard_version::allow_earliest |
+ standard_version::allow_stub);
+ }
+ catch (const invalid_argument& e)
+ {
+ throw invalid_value (o, v, e.what ());
+ }
+ }
+
void parser<auth>::
parse (auth& x, bool& xs, scanner& s)
{