On Sat, 17 Aug 2002, Bret Hughes wrote:

> On Sat, 2002-08-17 at 00:23, Werner Puschitz wrote:
> > 
> > Is there a simple way to find out which RPM version is newer?
> > 
> > For instance I have a bunch of RPM files with the same RPM name but with
> > different version numbers.
> > Doing a numeric comparison doesn't work in all cases since some versions
> > contain letters like "x", "p", etc. And doing a string comparison doesn't 
> > work either when you have numbers like "9" and "13" which would result in 
> > "9" being greater.
> > 
> > Is there a simple method to find out which RPM version is newer?
> > 
> I compare buildtimes in the script I wrote to remove duplicate rpms from
> my local updates dir.
> 
> rpm -qp --queryformat '%{BUILDTIME}'
> 

I finally found a way to compare RPM versions.

I download the src RPM "rpmver" from rpmfind.net. The i386 RPM doesn't 
work on 7.3 due to shared library dependencies. So I downloaded the src 
RPM and I rebuilt it on 7.3.


# rpmver
RPM version comparation tool - Version 1.2.2

Usage:   rpmver <version_string1> <version_string2>
         rpmver --version
              (version and license information)

version_string = Epoch:Version-Release
Epoch and/or Release can be omited

Example: rpmver 1.1a 1.1test
         rpmver 1.2-1cl 1.3-99cl

Return codes:
         1 - Version1 is newer
         0 - Versions are equal
        -1 - Version2 is newer
        -2 - rpmver version and copyright info returned
        -3 - Paramter error, returning usage info
        -4 - Version too long error

        -5 - Release or Epoch only present in one of the version strings
        -6 - Epoch must be a positive integer
#


Example:
# rpmver glibc-profile-2.2.5-37.i386.rpm glibc-profile-2.2.5-39.i386.rpm
RPM version comparation tool - Version 1.2.2

glibc-profile-2.2.5-39.i386.rpm is newer
#


Werner




-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to