Version comparison algorithm

Gustavo Niemeyer gustavo at niemeyer.net
Fri Nov 24 12:15:34 PST 2006


> > According to RPM's algorithm, yes.  It depends on the backend
> > used really (RPM vs. DEB vs. ...).
> 
> ASCII(2) = 50
> ASCII(j) = 106
> 
> Reverse logic? ;)

Next you'll say that "2" is larger than "10"!?  Comparing a version
string is much more complex than a simple ASCII value comparison.  Not
to mention that it's impossible to get all cases right, since version
strings are made for humans. ;-)

-- 
Gustavo Niemeyer
http://niemeyer.net



More information about the Smart mailing list