On 10/27/05, Howard Lowndes
<[EMAIL PROTECTED]> wrote:
> Therein lies the rub. You tell me what is the basename in these:
>
> zlib-1.2.2.2-4.fc4.i386.rpm
> zlib-1.2.2.2-5.fc4.i386.rpm
>
> xorg-x11-Xvfb-6.8.2-37.FC4.45.i386.rpm
> xorg-x11-Xvfb-6.8.2-37.FC4.48.1.i386.rpm
> xorg-x11-Xvfb-6.8.2-37.FC4.49.2.i386.rpm
> xorg-x11-Xvfb-6.8.2-37.i386.rpm
>
> util-linux-2.12p-9.10.i386.rpm
> util-linux-2.12p-9.11.i386.rpm
> util-linux-2.12p-9.12.i386.rpm
> util-linux-2.12p-9.5.i386.rpm
> util-linux-2.12p-9.7.i386.rpm
> util-linux-2.12p-9.9.i386.rpm
I don't consider myself an RPM wizard (I'm a debian person, forced to
learn RedHat admin at work) but a quick look at "man rpm" came up with:
rpm -q --qf="%{NAME}" -p <rpm-file-name>
will print out the package's name.
Now how about about that? :)
Actually - maybe you can extract the build date from the rpm file as well using
--qf "%{BUILDTIME}". So maybe something like (untested):
rpm -q --qf="%{NAME} %{BUILDTIME} %{NAME}-%{VERSION}-%{RELEASE}-%{ARCH}.rpm\n" \
| sort -n --key 2 | sort -u --key 1 | awk '{ print $3 }'
Will print out the names of files you should KEEP (maybe you'll have
to reverse the sort order). You might use comm(1) to reverse this to the
list of files you should delete.
> > Yet another option to achieve your original goal (share a downloaded file
> > among multiple local machines) - setup an HTTP proxy which will
> > automatically
> > keep a copy the first time a file is accessed and cull old files like any
> > other
> > unused cache entries.
>
> ...but at some stage the cache has to be allowed to expire.
Yes, right.
Actually - what's exactly is the issue with keeping around very old
packages? As far as I understand the situation he can take advantage
of a local copy for new packages (when upgrading the entire hen house)
but once a package was upgraded then how much does he expect to
really take advantage of that .rpm file lying around?
Cheers,
--Amos
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html