Re: automatically removing older rpms from a dir after updating

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Schwendt said:
> On Tue, 12 Aug 2003 03:21:17 -0400, Eric Bourque wrote:
>> I would like to use NFS based kickstart installs, and would therefore
>> like to apply all of the updates to my RedHat/i386/RPMS directory, which
>> requires removing all versions of an rpm but the most recent. Is anyone
>> aware of a script which will do such a thing? There used to be something
>> called munge rpm but I can't find it anymore ...
>
> Seen recently on fedora-devel, two helper tools:
>
>   http://www.fedora.us/pipermail/fedora-devel/2003-July/001828.html
>
> Feel free to follow up there.

Or if you'd like to write your own simple script - the only trick
is of course comparing two epoch/version/release

Here's a simple script that I though was the easiest way to compare
two same packages.
The last line has probably wrapped due to email.

#!/usr/bin/python
#
# usage: $0 Epoch1 Version1 Release1 Epoch2 Version2 Release2
#
# prints:	-x	if 1 < 2
#		0	if 1 = 2
#		x	if 1 > 2
#
import rpm
import sys
print
rpm.labelCompare((sys.argv[1],sys.argv[2],sys.argv[3]),(sys.argv[4],sys.argv[5],sys.argv[6]))

-- 
-Cheers
-Andrew

MS ... if only he hadn't been hang gliding!


-- 
Shrike-list mailing list
Shrike-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/shrike-list

[Index of Archives]     [Fedora Users]     [Centos Users]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat Phoebe Beta]     [Yosemite Forum]     [Fedora Discussion]     [Gimp]     [Stuff]     [Yosemite News]

  Powered by Linux