Kapil Arya created MESOS-1987:
---------------------------------

             Summary: Add better support for handling arbitrary long versions 
strings in stout/versio.hpp
                 Key: MESOS-1987
                 URL: https://issues.apache.org/jira/browse/MESOS-1987
             Project: Mesos
          Issue Type: Bug
            Reporter: Kapil Arya
            Assignee: Kapil Arya


Currently, the Version class handles strings of the form X.Y.Z only. A recent 
patch (https://reviews.apache.org/r/27115/) allows for strings of the form 
X.Y.Z-* by discarding the "-" along with the rest of the string following it. 
This means that the check `Version("0.20.1") == Version("0.20.1-rc2")` will 
succeed. 

A better fix is to allow arbitrary number of components in the Version string 
and still do the right thing w.r.t. comparisons.  To standardize it a bit, we 
can consider Semantic Versioning (http://semver.org/).

Semantic Versioning allows for strings of the following tagformat:
<code>
"MAJOR.MINOR.PATCH-IDENTIFIER[.IDENTIFIER]*"
</code>

An IDENTIFIER  must comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-].

One way to implement it in the Version class is to keep a vector of (string) 
identifiers along with major, minor, and patch variable. Another alternative is 
to not have the major, minor, and patch variables and just have a single vector 
of strings.

The comparison can be tricky.  One has to consider the pre-release version, 
etc. as explained in SemVer 2.0.0 RFC.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to