[Development] Adding support for version number comparisons
Stephen Kelly
stephen.kelly at kdab.com
Wed May 14 14:12:40 CEST 2014
On Sunday, May 11, 2014 13:42:25 Keith Gardner wrote:
> Other comparison rules:
>
> 1. Numerical groupings should be compared integers instead of characters
> in order to properly allow for "alpha2" < "alpha11".
> 2. Delimiters should only be used to denote groups of content but be
> skipped during the compare. "alpha" == "-alpha" == "~alpha" == ".alpha"
> 1. Can be restricted to the first character if this is too broad.
Given that we're numbering things, your last point would probably be better-
numbered 3 instead of 1 again, right?
Note also that version number schemes for particular software are not constant
over time.
https://blog.qt.digia.com/blog/2009/09/03/qt-4th-edition-feature-pack-7/
Are Windows versions in scope?
I changed grantlee versions to drop a 'v' at some point.
http://www.grantlee.org/downloads/
I'm sure there are other examples in the past and in the future. I didn't read
closely enough to see if that affects your proposal at all.
My bikeshed color is that a version comparator should only do 'component-wise
numeric comparison' and shouldn't also try to handle prefixes and suffixes
etc. I'm just adding that because I don't really support any side of this
discussion beyond bikeshedding.
Thanks,
--
Join us at Qt Developer Days 2014 in Berlin! - https://devdays.kdab.com
Stephen Kelly <stephen.kelly at kdab.com> | Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-Independent Software Solutions
More information about the Development
mailing list