Bug 174340 - queryformat formatting incorrect
queryformat formatting incorrect
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Panu Matilainen
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2005-11-28 05:27 EST by JW
Modified: 2008-01-25 12:22 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-01-25 12:22:33 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 JW 2005-11-28 05:27:47 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (compatible; MSIE 6.0; Windows; U; AIIEEEE!; Win98; Windows 98; en-US; Gecko masquerading as IE; should it matter?; rv:1.8b) Gecko/20050217

Description of problem:
The queryformat printf-style printing doesn't always work.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. rpm -q --queryformat "%.10{INSTALLTIME:date}\n" kernel
2. rpm -q --queryformat "%|INSTALLTIME?%.10{INSTALLTIME:date}:{}|\n" kernel

Actual Results:  1. "Wed 23 Nov"
2. "Wed 23 Nov 2005 05:45:39 PM EST"

Expected Results:  Both should output "Wed 23 Nov" or whatever.

Additional info:

Would it also be possible to add a ":idate" or perhaps something to output ISO8601 format, or perhaps ":%Y" etc which would be strftime-style date formatters (the '%' may or may not be a problem)?

Probably too much trouble I suppose.
Comment 1 Paul Nasrat 2005-11-28 09:11:36 EST
Confirmed against rpm-4.4.2-7.i386
Comment 2 Jeff Johnson 2005-11-28 12:07:59 EST
[jbj@wellfleet ~]$ rpm -q --queryformat "%.10{INSTALLTIME:date}\n" kernel
Fri 18 Nov
Sun 27 Nov
[jbj@wellfleet ~]$ rpm --version
RPM version 4.4.4
Comment 3 Paul Nasrat 2005-11-28 17:55:02 EST
Yes that works for me too - but if it's in conditional it doesn't

rpm -q --queryformat "%|INSTALLTIME?{%.10{INSTALLTIME:date}}|\n" kernel
Sat 19 Nov 2005 10:54:39 AM EST
Fri 25 Nov 2005 10:36:40 AM EST

Does rpm 4.4.4 fix that case?
Comment 4 Jeff Johnson 2005-11-30 14:34:24 EST
Dunno. Why don't *YOU* try ?
Comment 6 Panu Matilainen 2007-08-09 15:55:17 EDT
Still happens with rpm (not big surprise there...), moving version to devel.
Comment 7 Panu Matilainen 2008-01-25 12:22:33 EST
[pmatilai@localhost ~]$ rpm -q rpm

[pmatilai@localhost ~]$ rpm -q --queryformat
"%|INSTALLTIME?{%.10{INSTALLTIME:date}}|\n" kernel
Fri 21 Dec
Fri 25 Jan

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