Bug 16617 - --queryformat, field width lossage
--queryformat, field width lossage
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Panu Matilainen
: 323221 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2000-08-20 02:13 EDT by Jeff Johnson
Modified: 2008-01-25 12:14 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-01-25 12:14:32 EST
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 Jeff Johnson 2000-08-20 02:13:29 EDT
I am trying to get --queryformat to format the output of a query,
however, it doesn't seem to work consistently.  What I would like to do
is list all the files in a package padded in a field of 50 characters,
however, when using an iterator to list those filenames it seems to not
honor the field width specifier.  Here is what I have so far:

rpm -qp --queryformat '[%{FILENAMES}\t%{FILESIZES}\n]' zoo-2.10-4.i386.rpm

But I would like to do

rpm -qp --queryformat '[%-50{FILENAMES}%{FILESIZES}\n]' zoo-2.10-4.i386.rpm

however, the -50 seems to have no effect.  If I remove the [] iterator
from around the %{FILENAMES} variable it prints the field properly, but
as you can imagine, it doesn't print all the filenames---just the
first.  So, has anyone come with a nifty workaround for this problem
with --queryformat?
Comment 1 Jeff Johnson 2000-08-20 02:16:01 EDT
(from Andy Bradford <bradipo@xmission.com> on rpm-list)
Comment 2 Alan Cox 2002-12-14 20:18:33 EST
In rpm 4.0 the field width works and the multifilename works but there is a 
different funny bug

rpm -q --queryformat '[%-50{FILENAMES}%{FILESIZES}\n]' binutils 
fails to format nicely

rpm -q --queryformat '[%-50{FILENAMES} %{FILESIZES}\n]' binutils
works properly

Comment 3 Jeff Johnson 2003-01-09 09:37:09 EST
Problem exists in rpm-4.2-0.54.
Comment 4 Paul Nasrat 2005-09-29 13:39:35 EDT
Problem exists in rpm-4.4.2-4

 h.sprintf("%-50{name} %{version}")
'time                                               1.7'
Comment 5 Red Hat Bugzilla 2007-08-21 01:16:47 EDT
User pnasrat@redhat.com's account has been closed
Comment 6 Panu Matilainen 2007-08-22 02:29:52 EDT
Reassigning to owner after bugzilla made a mess, sorry about the noise...
Comment 7 Panu Matilainen 2008-01-25 12:13:50 EST
*** Bug 323221 has been marked as a duplicate of this bug. ***
Comment 8 Panu Matilainen 2008-01-25 12:14:32 EST
Fixed in

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