[pacman-dev] vercmp discussion

Allan McRae allan at archlinux.org
Thu Jul 17 08:54:49 EDT 2008

Xavier wrote:
> On Wed, Jul 16, 2008 at 10:17 PM, Nagy Gabor <ngaba at bibl.u-szeged.hu> wrote:
>>> nicer, but harder ;-)
>>> See 84283672853350a84d2a71b72dc06e180cad1587, search for 'type
>>> mismatch'.
>> Hm. Wrong. With the new vercmp: 1.1 > 1.b (but in ASCII 'b' > '1'),
>> strange. Our problem is at the end of string: '\0' vs. alpha, as I see,
>> this case was handled after comment /* see if we ran out of segments on
>> one string */
> It indeed looks like we just need to handle the case where it runs out
> of segments on one string.
> But we have to handle two cases : run out of segments with the
> -release number or without it.
> So in both cases, I handle it differently if the last remaining
> segment starts with a letter or not.
> I am not 100% sure that it will work correctly in every single cases,
> but the logic seems alright, there is no regression on all existing
> vercmp test, and the 4 new tests you posted in an older thread now
> pass fine.

You do realize you just broke openssh version numbering 

Here is my vote for the best order:
1.0alpha < 1.0beta < 1.0pre < 1.0rc < 1.0 < 1.0a < 1.0b < 1.0c

</massive flame!>

More information about the pacman-dev mailing list