On Monday, 20 December 2004, at 02:21:56 (-0500), seth vidal wrote:
How can it do it better than rpm? Either it's the same as rpm or it's wrong.
any other version comparison result is incorrect.
For rpm, sure. But for general comparison of version strings, it gets some right that rpm gets wrong. (For example, it knows 2.5.4p1 > 2.5.4 while 2.5.4beta7 < 2.5.4.)
just use the python modules. They link in directly to the rpmlib and use its version comparison functions.
Using the appropriate rpmlib bindings for whatever language one is using is always the most accurate approach. But if one chooses to not do so, it's good to understand the principles behind how the comparison works.
Michael