Bug 165335 - RFE: rpm --compare-versions ver1 op ver2
RFE: rpm --compare-versions ver1 op ver2
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
Mike McLean
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-08-08 00:21 EDT by Jeff Moe (jebba)
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-08-25 13:00:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jeff Moe (jebba) 2005-08-08 00:21:56 EDT
It is difficult to compare version numbers of packages to find out which one is
the most recent with RPM. Trying to do this in a simple shell script is near
impossible... It would be cool if you could feed `rpm` two packages and have it
return which is more recent. Debian's dpkg does this and it's quite nice. From
dpkg manpage:

dpkg --compare-versions ver1 op ver2
Compare  version  numbers,  where  op  is a binary operator.  dpkg returns
success (zero result) if the specified condition is satisfied, and failure
(nonzero result) otherwise. There are two groups of operators, which differ in
how they treat an empty ver1 or ver2. These treat an empty version as earlier
than any version: lt le  eq  ne  ge  gt. These treat  an  empty  version as
later than any version: lt-nl le-nl ge-nl gt-nl.  These are provided only for
compatibility with control file syntax: < << <= = >= >> >.
Comment 1 Jeff Johnson 2005-08-25 13:00:28 EDT
This script can be done in 10-20 lines of python, actually exists someplace.

Meanwhile, comparing versions has almost nothing to do with package management,
and so this does *NOT* belong on the rpm CLI (IMHO).
Comment 2 R P Herrold 2005-08-25 13:57:17 EDT
missed this one when it came through. see: ORC-rpm-ver-cmp at:
ftp://ftp.owlriver.com/pub/mirror/ORC/buildfarm/, which wrappes and adds sanity
checking to Seth's /usr/bin/fedora-rpmvercmp (which is itself already in:
fedora-rpmdevtools

This performs the requested comparisons

Note You need to log in before you can comment on or make changes to this bug.