From c27b069ab3049e566738bc7a63e9b8fa57657553 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 28 Apr 2017 09:04:14 +0200 Subject: Use standard_version for module versioning checks --- build2/utility | 41 +++++++---------------------------------- 1 file changed, 7 insertions(+), 34 deletions(-) (limited to 'build2/utility') diff --git a/build2/utility b/build2/utility index 95766a4..860c841 100644 --- a/build2/utility +++ b/build2/utility @@ -17,7 +17,6 @@ #include #include // combine_hash(), reverse_iterate(), case*(), etc -#include #include @@ -104,9 +103,14 @@ namespace build2 // extern process_path argv0; - // Build system driver version. + // Build system driver version and check. // - extern butl::standard_version build_version; + extern standard_version build_version; + + class location; + + void + check_build_version (const standard_version_constraint&, const location&); // Work/home directories (must be initialized in main()) and relative path // calculation. @@ -418,37 +422,6 @@ namespace build2 string apply_pattern (const char* stem, const string* pattern); - // Parse version string in the X.Y.Z[-{a|b}N] to a version integer in the - // AABBCCDD form, where: - // - // AA - major version number - // BB - minor version number - // CC - bugfix version number - // DD - alpha / beta (DD + 50) version number - // - // When DD is not 00, 1 is subtracted from AABBCC. For example: - // - // Version AABBCCDD - // 2.0.0 02000000 - // 2.1.0 02010000 - // 2.1.1 02010100 - // 2.2.0-a1 02019901 - // 3.0.0-b2 02999952 - // - // For a version in the 1.2.3- form, it returns (AABBCC-1)01, which is the - // lowest possible version in the 1.2.3 release set. For example: - // - // Version AABBCCDD - // 2.2.0- 02019901 - // 1.2.3- 01020201 - // - // In fact versions 1.2.3- and 1.2.3-a1 are equivalent. - // - // Throw invalid_argument if the passed string is not a valid version. - // - unsigned int - to_version (const string&); - // Initialize build2 global state (verbosity, home/work directories, etc). // Should be called early in main() once. // -- cgit v1.1