[TriLUG] Filtering RPM versions

David McDowell turnpike420 at gmail.com
Tue Dec 21 15:08:56 EST 2004


Can you write a script that uses regex to compare each package name
and its subsequent version number and if it has more than one, delete
all other versions with a lower number?

pkg-2.4-5.i386.rpm
pkg-2.4-6.i386.rpm
pkg-2.7-1.i386.rpm

it would find "pkg" then the first "-" then the numbering and compare
which is highest number and ditch the rest...

good luck... my regex fu is non-existent.  :)

David McD


On Tue, 21 Dec 2004 14:58:38 -0500, Kevin Otte <nivex at nivex.net> wrote:
> Given a directory full of RPMs, some of which are the same package, just
> different versions (eg:
> http://download.fedora.redhat.com/pub/fedora/linux/core/updates/3/i386/ ),
> is there some method of deleting all but the most current version of the
> RPMs contained therein?
> 
> The reason for this is to put together a CD (perhaps DVD depending on size)
> of just the most current updates to send to someone who is still stuck out
> in dialup land.
> 
> --
> Kevin Otte, N8VNR
> nivex at nivex.net
> http://www.nivex.net/
> 
> -=-
> 
> "Those who cannot remember the past are condemned to repeat it."
> -- George Santayana
> 
> "It seems no one reads Santayana anymore."
> -- Cdr. Susan Ivanova, Babylon 5
> 
> --
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ  : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> TriLUG PGP Keyring         : http://trilug.org/~chrish/trilug.asc
>



More information about the TriLUG mailing list