Re: How does rpm command compare 2 rpm files' version?
- From: "Enrique Perez-Terron" <enrio@xxxxxxxxx>
- Date: Wed, 28 Dec 2005 18:12:48 +0100
On Wed, 28 Dec 2005 13:09:38 +0100, Markku Kolkka <markku.kolkka@xxxxxx> wrote:
Klein wrote:
If 2 rpms have the following information:
a.rpm (old one)
Package name: ABC
Version: 1.00.pre1
a.rpm (new one)
Package name ABC
Version: 1.00.beta1
If I have installed the new one, and want to use rpm command to
upgrade it with the old one, what is the result?
Because the "old" package has a version that's later in sort order than
the "new" package, RPM believes the package version 1.00.pre1 is an
update and installs it without complaints.
You should version the packages e.g. like this:
a.rpm (old one)
Package name: ABC
Version: 1.00
Release: 0.1.pre1
a.rpm (new one)
Package name ABC
Version: 1.00
Release: 0.2.beta1
Now the version/release is in correct ascending order. Older versions of
the package can be installed with the "--oldpackage" switch of the rpm
command.
Just for the record, when comparing two versions strings or two realease
strings, rpm breaks up the strings into alternating non-numeric and
numeric sequences, and compare the non-numeric sequences as strings
(unsigned bytes, iirc) and the nummeric parts as numbers (so 1 < 2 < 10).
My memory fails me at this point: I believe, but cannot remember if it is
so, that it first breaks the strings at the dots, and then each part in
alternating non-numeric and numeric parts. I don't remember what it does
with e.g 1.a and 1.1. It is possible that it assumes an empty non-
numeric sequence after the dot in the latter string.
Also be aware that a complete version-release string also comprises an
"epoch" that defaults to zero, and is prepended: 0:1.1-1.pre is
epoch 0, version 1.1 release 1.pre. The epoch is used when external
factors force versions strings that are out of order.
-Enrique
.
Relevant Pages
- Re: How does rpm command compare 2 rpm files version?
... > Package name ABC ... > If I have installed the new one, and want to use rpm command to ... Now the version/release is in correct ascending order. ... (comp.os.linux.development.system) - How does rpm command compare 2 rpm files version?
... Package name ABC ... If I have installed the new one, and want to use rpm command to upgrade ... (comp.os.linux.development.system) - [PATCH 1/2] kbuil: add deb-pkg target
... # To prepare kbuild for more kernel packaging formats move all packaging ... # In top-level Makefile introduce generic support for all package ... Included the old rpm target for backward ... # and builddeb scripts. ... (Linux-Kernel) - Re: Conventions for NFS sharing of binaries
... Do you have distro & local packages with same name? ... mount it r/w on your "master installation machine" (with RPM management). ... If you replace a package with a different one with the same name, hmm, you ... (comp.os.linux.misc) - Re: ./configure command
... The package is not available. ... machines which don't even have an OS at all, let alone RPM, ... There is not a "the tool to package and install on Fedora". ... If he wants to avoid trouble, ... (Fedora) |
|