From c7c3fd96e97ae2ec3914d36cb920a6f02c9a3414 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 15 Jan 2016 16:32:13 +0200 Subject: Support X.Y.Z- version notation --- build2/utility | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'build2/utility') diff --git a/build2/utility b/build2/utility index 5240e4d..9245d86 100644 --- a/build2/utility +++ b/build2/utility @@ -24,8 +24,32 @@ namespace build2 extern const dir_path empty_dir_path; // Parse version string in the X.Y.Z[-{a|b}N] to a version integer in the - // AABBCCDD form as describe in . Throw invalid_argument - // if the passed string is not a valid version. + // 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&); -- cgit v1.1