Re: How does rpm command compare 2 rpm files' version?
- From: Markku Kolkka <markku.kolkka@xxxxxx>
- Date: Thu, 29 Dec 2005 17:01:32 +0200
Klein wrote:
> But could you please tell me where can I find the offical rules of rpm
> version comparation, because I need to find the offical information
> about this to decided how to compare 2 rpm files with the version that
In the documentation distributed with the rpm program, in my Fedora Core
4 system it's in /usr/share/doc/rpm-4.4.1/
A quote from the file "dependencies":
"The algorithm that RPM uses to determine the version ordering of
packages is simple and developers are encouraged not to rely on the
details of its working. Developers should keep their numbering scheme
simple so any reasonable ordering algorithm would work. The version
comparison algorithm is in the routine rpmvercmp() and it is just a
segmented
strcmp(3). First, the boundaries of the segments are found using
isdigit(3)/isalpha(3). Each segment is then compared in order with the
right most segment being the least significant. The alphabetical
portions are compared using a lexical graphical ascii ordering, the
digit segments strip leading zeroes and compare the strlen before
doing a strcmp. If both numerical strings are equal, the longer string
is larger. Notice that the algorithm has no knowledge of decimal
fractions,
and perl-5.6 is "older" than perl-5.00503 because the number 6 is less
than
the number 503."
--
Markku Kolkka
markku.kolkka@xxxxxx
.
- Follow-Ups:
- References:
- How does rpm command compare 2 rpm files' version?
- From: Klein
- Re: How does rpm command compare 2 rpm files' version?
- From: Markku Kolkka
- Re: How does rpm command compare 2 rpm files' version?
- From: Enrique Perez-Terron
- Re: How does rpm command compare 2 rpm files' version?
- From: Klein
- How does rpm command compare 2 rpm files' version?
- Prev by Date: Doubt about no_page method in VMA
- Next by Date: Re: I/O priority
- Previous by thread: Re: How does rpm command compare 2 rpm files' version?
- Next by thread: Re: How does rpm command compare 2 rpm files' version?
- Index(es):
Relevant Pages
|