I have not been able to find a way of asking RPM to search through a collection of _uninstalled_ rpm files, and report which (if any) of them contains a particular file. The closest I have gotten is cd /mnt/cdrom/RedHat/RPMS rpm -q -p *.rpm -l | egrep {pattern} which will dump all file names from the entire distribution and show those that match the {pattern}, but it doesn't show which rpm I would need to install to get the selected file(s). I had first tried rpm -q -p *.rpm -f {name} but this complains: rpm: one type of query/verify may be performed at a time I have now run into a need for this sort of query twice, most recently to find out which source rpm contains loadlin. I think the answer may be that the distribution does not provide the loadlin source code :( which is not good because there appears to be a bug in it :(((
Try rpm -qp --queryformat '[%{=NAME}: %{FILENAMES}\n]' *.rpm | grep ... (from "Maximum RPM" pg 73).
That's a pretty slick capability -- maybe it could be added to the manpage? I just looked at the 19 August 1997 version as displayed by "info rpm", and if it's there I couldn't find it, nor any mention at all of using "[" in --queryformat.
The man pages for rpm will be reworked in the next month or so.
Man pages are reworked. The use of the iterator is best found by reading Maximum RPM. A new version is due out in the next couple of months.