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

Re: rpm version comparisons...

On Sat, 2003-01-18 at 08:30, James Olin Oden wrote:

<snip to the rpmvercmp explanation>

>                   Now that we have all the sections, compare each one
>                   from left to right (in decreasing magnitude in
>                   other words):
>                         -  If either of the version segments are empty
>                            B is the newer one.  This is quite arbitrary
>                            but it is the way it works (and I am not sure
>                            what other methodology would be better; if this
>                            was a problem with a package, then its probably
>                            time to use epoch's.).
>                         -  If the version segment is numerical:
>                                 - Throw out leading zeros.
>                                 - If one number has more digits, that one
>                                   is newer.
>                         - use strcmp() from stdio to compare the segments.
>                           Whichever version segment is greater is newer.
>                 - At this point whichever version string still has characters
>                   left over is newer.

This isn't entirely right, but, in general, you should never need to
know the low-level internal details of rpmvercmp.  Are you having a
specific problem with rpm?


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