[Development] Adding support for version number comparisons

Jake Petroules jake.petroules at petroules.com
Sat May 10 21:28:03 CEST 2014


And what about 1.0.0b2? Wouldn't you expect that to be greater than 1.0.0b? The problem with trying to implement one comparison algorithm is that there are so many different versioning formats in use (at least, within the suffix part) that it's nearly impossible to do something that works reasonably well for all of them at the same time.

At the absolute least we should have some means to use a custom suffix comparison (compare() overload that takes a function as a parameter?).
-- 
Jake Petroules - jake.petroules at petroules.com
Chief Technology Officer - Petroules Corporation

On 2014-05-10, at 03:20 PM, Keith Gardner <kreios4004 at gmail.com> wrote:

> Let's not make it that complicated.  If the suffix is one character, assume that it stands for a released version.  If the suffix is greater than one character, assume it references a pre-released version.  With this rule, comparisons will work properly. "1.0.0beta" < "1.0.0" < "1.0.0b".
> 
> 
> On Sat, May 10, 2014 at 1:18 PM, Jake Petroules <jake.petroules at petroules.com> wrote:
> On 2014-05-10, at 02:11 PM, Thiago Macieira <thiago.macieira at intel.com> wrote:
> 
> > Em sáb 10 maio 2014, às 14:03:10, Jake Petroules escreveu:
> >> With all the debate, I'm beginning to think that having distinct formats
> >> available to conform to might not be such a bad idea after all (SemVer,
> >> RpmVer, Dpkg, Freeform, etc...).
> >
> > So how do you mean 1.0.0b compare greater than 1.0.0? (OpenSSL)
> >
> > --
> > Thiago Macieira - thiago.macieira (AT) intel.com
> >  Software Architect - Intel Open Source Technology Center
> >
> > _______________________________________________
> > Development mailing list
> > Development at qt-project.org
> > http://lists.qt-project.org/mailman/listinfo/development
> 
> 
> OK, if suffix begins with '-', compare < empty, else, compare > empty.
> --
> Jake Petroules - jake.petroules at petroules.com
> Chief Technology Officer - Petroules Corporation
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20140510/227eb831/attachment.html>


More information about the Development mailing list