Subject: Re: Comparing version numbers
To: None <tech-pkg@netbsd.org>
From: Julien Letessier <julien.letessier@sun.com>
List: tech-pkg
Date: 08/05/2002 09:35:48
Alistair Crooks wrote:
>>>'rc' encodes as release candidate, which is -1
>>
>>No, not just "-1". How do you compare "1.rc2" against "1.rc3"?
(snip)
> Thanks for your suggestion, but I believe you've completely missed
> the point. If "rc" was encoded to ".0.", then 1.0rc1 would be
> greater than 1.0. The whole point of making "rc" negative was so
> that release candidates would sort BEFORE the release.
Anyways, thanks everybody for the help.
Al: the C code helps much :)
though not documented, it's pretty clear!
I think this concludes the debate on version number comparison. The
current algorithm is pretty clever, and easy to implement in any
language (in my case, python).
Cheers,
--
Julien T. Letessier
Sun Labs Europe, Meylan, France
julien.letessier@sun.com