This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: upset, genini: different version ordering


On 20/07/2015 19:10, Jon TURNEY wrote:
On 20/07/2015 19:03, Achim Gratz wrote:
I've just found that upset and genini will order versions differently.
For perl-Carp, genini produces:
[...]
If I recall correctly, genini is just broken, doing some kind of lexical
sort which e.g. sorts 1.10 before 1.9.
Something which seems to be missing from this discussion is how Cygwin version numbers are supposed to be sorted.

This needs to be simple, documented (and ideally, similar to other package managers), so that package maintainers can easily anticipate how their package versions are going to be ordered, but [1] seems silent on this subject, apart from describing it as 'intuitive'

Here's a list of existing package versions ordered by upset, which I think sort differently in setup:

x86:

makeself 2.1.5+20120813+gitdcbe778-1 < 2.1.5-3
tcl-itcl 3.4b1-1                     < 3.4.1-1
tidy     20090325-1                  < 041206-1
wput     0.6.2+git20130413-2         < 0.6.2-1

x86_64:

bzr      2.6.0+bzr6602-1 < 2.6.0-2 < 2.6b2-1
cgdb     0.6.7+20150214+git3a710f9-1 < 0.6.7-1

The result for tidy is particularly unexpected, and looking at the date of the package files, just wrong. (This appears to be due to upset truncating numeric parts to 4 digits!)

I don't really want to spend effort on unravelling the complexities of the sorting that upset does, since I don't think it's worth keeping, and we should switch to a scheme which can be described in a paragraph,
e.g. the scheme used by setup and RPM:

Compare contiguous chunks of digits or non-digits.
Non-digit chunks sort before digit chunks.
Digit chunks sort numerically, non-digit chunks sort lexicographically.
The version with a suffix remaining is the greater

[1] https://cygwin.com/setup.html


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]