From 1b9d5cd435b800adad6432bca91cac189ad58823 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 1 May 2017 16:24:12 +0200 Subject: Use standard version in bootstrap manifest --- bbot/bootstrap-manifest.cxx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'bbot/bootstrap-manifest.cxx') diff --git a/bbot/bootstrap-manifest.cxx b/bbot/bootstrap-manifest.cxx index 0d6e6b5..ebbc7ce 100644 --- a/bbot/bootstrap-manifest.cxx +++ b/bbot/bootstrap-manifest.cxx @@ -75,15 +75,17 @@ namespace bbot // Package version. // - size_t vn; - uint64_t pv (stoull (v, &vn)); - if (vn != v.size ()) - bad_value ("invalid package version"); - - // Make sure the package version is not redefined. - // - if (!versions.emplace (move (pn), pv).second) - bad_name (n + " redefinition"); + try + { + // Make sure the package version is not redefined. + // + if (!versions.emplace (move (pn), standard_version (v)).second) + bad_name (n + " redefinition"); + } + catch (const invalid_argument& e) + { + bad_value (string ("invalid package version: ") + e.what ()); + } } else if (!iu) bad_name ("unknown name '" + n + "' in bootstrap manifest"); @@ -105,7 +107,7 @@ namespace bbot // Serialize *-version values. // for (const auto& v: versions) - s.next (v.first + "-version", to_string (v.second)); + s.next (v.first + "-version", v.second.string_project ()); s.next ("", ""); // End of manifest. } -- cgit v1.1