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

Re: rpmvercmp is kinda broken, always has been

On Fri, Jan 03, 2003 at 11:36:28AM -0600, Chris Garrigues wrote:

Hmmm, comparison modulo 503 make 503 < 6 ;-)

> I noticed in his original email he was actually asking about 00503 being less 
> than 6, not 503.
> Clearly there's a special case that could be defined for version numbers which 
> have leading zeros.
> Equally clearly, it would be hard to come up with a special case which 
> wouldn't break something else.
> The only idea that comes to my mind is if one of the numbers has leading 
> zeros, then the other number needs to be padded with the same number of 
> leading zeros and then they can be compared like strings.
> This would mean (00503 cmp 006) instead of (503 <=> 6).  (Pardon the perl syntax.)
> I haven't figure out what that would break yet, but I know there's something.

Yup, finding what breaks with any new scheme is a lotta work, and is the rate
limiting step.

73 de Jeff

Jeff Johnson	ARS N3NPQ
jbj@redhat.com (jbj@jbj.org)
Chapel Hill, NC

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