Bug 16617

Summary: --queryformat, field width lossage
Product: [Fedora] Fedora Reporter: Jeff Johnson <jbj>
Component: rpmAssignee: Panu Matilainen <pmatilai>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: imc, suckfish
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-01-25 17:14:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jeff Johnson 2000-08-20 06:13:29 UTC
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 06:16:01 UTC
(from Andy Bradford <bradipo> on rpm-list)

Comment 2 Alan Cox 2002-12-15 01:18:33 UTC
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 14:37:09 UTC
Problem exists in rpm-4.2-0.54.

Comment 4 Paul Nasrat 2005-09-29 17:39:35 UTC
Problem exists in rpm-4.4.2-4

h.sprintf("%-50{name}%{version}")
'time1.7'
 h.sprintf("%-50{name} %{version}")
'time                                               1.7'

Comment 5 Red Hat Bugzilla 2007-08-21 05:16:47 UTC
User pnasrat's account has been closed

Comment 6 Panu Matilainen 2007-08-22 06:29:52 UTC
Reassigning to owner after bugzilla made a mess, sorry about the noise...

Comment 7 Panu Matilainen 2008-01-25 17:13:50 UTC
*** Bug 323221 has been marked as a duplicate of this bug. ***

Comment 8 Panu Matilainen 2008-01-25 17:14:32 UTC
Fixed in 4.4.2.3-0.1.rc1