[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian version numbers and strcmp()



On Thu, 22 Jan 2009, Adeodato Simó wrote:
> I'd like to hear from members of this list what they think about the
> following issue: I just noticed that to determine whether two Debian
> versions are equal, one can't use strcmp() or similar, and must
> implement the full comparison algorithm. For example, 0.9 and 0.09
> are the same version according to Policy.

[...]

> Is there a reason for it to be this way? Is there a reason that
> would advise against changing it?

If version numbers aren't equal, there must be a greater than or less
than relationship between them. If you think that 0.9 and 0.09 should
not be equal, then a proposal for a rule to make the first greater
than or less than the other is needed. 

In my mind, these are no different than the difference between version
90 and version 090; they're not equal strings, but are certainly equal
version numbers (and equal numbers in general). Just like you can't
compare numbers for equality using strcmp, you can't compare versions
for equality using it either.


Don Armstrong

-- 
The state must declare the child to be the most precious treasure of
the people. As long as the government is perceived as working for the
benefit of the children, the people will happily endure almost any
curtailment of liberty and almost any deprivation.
 -- Adolf Hitler _Mein Kampf_ p403

http://www.donarmstrong.com              http://rzlab.ucr.edu


Reply to: