Bug 72732 - Request: Add queryformat {RPMFILE} to print name of file being inspected
Summary: Request: Add queryformat {RPMFILE} to print name of file being inspected
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm
Version: 7.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact:
URL:
Whiteboard:
Keywords: FutureFeature
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-08-27 02:46 UTC by Need Real Name
Modified: 2007-04-18 16:46 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed: 2005-09-29 18:36:36 UTC


Attachments (Terms of Use)

Description Need Real Name 2002-08-27 02:46:46 UTC
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.

Comment 1 Paul Nasrat 2005-09-29 18:36:36 UTC
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 {}



Note You need to log in before you can comment on or make changes to this bug.