diff options
author | John Hodge <tpg@ucc.asn.au> | 2019-06-23 15:37:54 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2019-06-23 15:37:54 +0800 |
commit | 155ab2b1e09a8a9a18c4c8201c85f61e7317ff34 (patch) | |
tree | c55019f452b5b26f469203b06915539a525f1150 | |
parent | 2b6c1a69fd4d36609e259fc6629c391aad4aa57f (diff) | |
download | mrust-155ab2b1e09a8a9a18c4c8201c85f61e7317ff34.tar.gz |
minicargo - Handle pre-release tags in version specifiers
-rw-r--r-- | tools/minicargo/manifest.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/minicargo/manifest.cpp b/tools/minicargo/manifest.cpp index 2f6d1ca5..5734e828 100644 --- a/tools/minicargo/manifest.cpp +++ b/tools/minicargo/manifest.cpp @@ -982,6 +982,17 @@ PackageVersionSpec PackageVersionSpec::from_string(const ::std::string& s) { pos ++; v.patch = H::parse_i(s, pos); + + if( pos < s.size() && s[pos] == '-' ) + { + // Save tag (sequence of dot-seprated alpha-numeric identifiers) + auto tag_start = pos+1; + do { + // Could check the format, but meh. + pos ++; + } while(pos < s.size() && !isblank(s[pos]) && s[pos] != ',' ); + //v.tag = ::std::string(s.c_str() + tag_start, s.c_str() + pos); + } } else { @@ -1005,7 +1016,7 @@ PackageVersionSpec PackageVersionSpec::from_string(const ::std::string& s) break ; } while(pos < s.size() && s[pos++] == ','); if( pos != s.size() ) - throw ::std::runtime_error(::format( "Bad version string, pos=", pos )); + throw ::std::runtime_error(::format( "Bad version string '", s, "', pos=", pos )); return rv; } bool PackageVersionSpec::accepts(const PackageVersion& v) const |