From d577b075a8f193a45ebbbd268582c4b60258c91e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 29 Apr 2017 15:19:32 +0200 Subject: Add support for stub versions in version module --- build2/parser.cxx | 2 +- build2/version/init.cxx | 8 ++++++-- build2/version/rule.cxx | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'build2') diff --git a/build2/parser.cxx b/build2/parser.cxx index d84ebfa..9dbce3b 100644 --- a/build2/parser.cxx +++ b/build2/parser.cxx @@ -1251,7 +1251,7 @@ namespace build2 if (!i->simple ()) fail (l) << "module version expected instead of " << *i; - v = standard_version (i->value, true); // Allow earliest. + v = standard_version (i->value, standard_version::allow_earliest); } catch (const invalid_argument& e) { diff --git a/build2/version/init.cxx b/build2/version/init.cxx index 3f8a42a..631d899 100644 --- a/build2/version/init.cxx +++ b/build2/version/init.cxx @@ -61,7 +61,11 @@ namespace build2 { try { - v = standard_version (nv.value); + // Allow the package stub versions in the 0+ form. + // While not standard, we want to use the version module for + // packaging stubs. + // + v = standard_version (nv.value, standard_version::allow_stub); } catch (const invalid_argument& e) { @@ -276,7 +280,7 @@ namespace build2 dist_callback (const path& f, const scope& rs, void* data) { module& m (*static_cast (data)); - const standard_version v (m.version); + const standard_version& v (m.version); // Complain if this is an uncommitted snapshot. // diff --git a/build2/version/rule.cxx b/build2/version/rule.cxx index 6632d55..3e143c1 100644 --- a/build2/version/rule.cxx +++ b/build2/version/rule.cxx @@ -474,7 +474,7 @@ namespace build2 if (verb >= 2) text << "ver -o " << tp << ' ' << ip; else if (verb) - text << "ver " << tp; + text << "ver " << ip; // Read and process the file, one line at a time. // -- cgit v1.1