From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0rc1) Gecko/20020417 Description of problem: When using rpm in a pipe it would be very handy to have the rpm file name under inspection get passed along with whatever other information is tagged for output. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 0. Get a collection of rpm files... 1. Desire a report on these rpm files which includes the file names... 2.rpm -qp --queryformat '%{name} %{rpmname}\n' `find -name '*.rpm'` Actual Results: rpm goes "huh???" and drinks all my gin. I had to code an evil and inefficient workaround. Expected Results: having %{rpmname} as a tag would help rpm play ball better in fancy pipes. Additional info: One ends up doing something like this: for i in `find -name '*.rpm'`; do rpm -qp --queryformat '%{name} ' \$i; echo \$i; done Which works, but which invokes rpm for each file, and is much slower. Of course a different tag name might be better, and it's even possible that rpm has this feature and I've missed it. Thanks for listening.
rpm file names are a convention set by %_build_name_fmt and not necessarily guaranteed to map from header (nvra) details to file name. Try find ~/rpm/ -name \*rpm | xargs -i rpm --qf "%{name} {}\n" -qp {}