Bug 72732 - Request: Add queryformat {RPMFILE} to print name of file being inspected
Request: Add queryformat {RPMFILE} to print name of file being inspected
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2002-08-26 22:46 EDT by Need Real Name
Modified: 2007-04-18 12:46 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-09-29 14:36:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2002-08-26 22:46:46 EDT
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:

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 14:36:36 EDT
rpm file names are a convention set by %_build_name_fmt and not necessarily
guaranteed to map from header (nvra) details to file name.


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.