Bug 962846 - --last does not honor --qf
--last does not honor --qf
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-14 10:53 EDT by Need Real Name
Modified: 2013-05-15 01:06 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-05-15 01:06:21 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2013-05-14 10:53:24 EDT
Description of problem:
--qf is ignored when used with --last

The man page states:
       --last Orders the package listing by install time such that the  latest
              packages are at the top.


Version-Release number of selected component (if applicable):
rpm-4.11.0.1-1.fc19.x86_64
rpm-4.9.1.3-8.fc17.x86_64

How reproducible:
Every time

Steps to Reproduce:
1. rpm -q kernel --last --qf '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n'
2.
3.
  
Actual results:
kernel-3.8.11-100.fc17                        Sat 04 May 2013 08:04:14 CEST
kernel-3.8.8-100.fc17                         Tue 30 Apr 2013 13:25:29 CEST
kernel-3.8.4-102.fc17                         Sun 31 Mar 2013 08:31:52 CEST
kernel-3.8.8-100.fc17.x86_64                  
kernel-3.8.4-102.fc17.x86_64                  
kernel-3.8.11-100.fc17.x86_64                 

Expected results:
kernel-3.8.8-100.fc17.x86_64                  
kernel-3.8.4-102.fc17.x86_64                  
kernel-3.8.11-100.fc17.x86_64                 


Additional info:
Comment 1 Panu Matilainen 2013-05-15 01:06:21 EDT
--qf is not exactly ignored, its appended... but that's unlikely to be what you expect either. The issue is that --last is implemented as a popt alias and it relies on a very specific --qf of its own to get its job done:

rpm     alias --last --qf '%|INSTALLTIME?{%{INSTALLTIME}}:{000000000}| %{NVRA} %|INSTALLTIME?{%{INSTALLTIME:date}}:{(not installed)}|\n' \
        --pipe "sort -r -n | sed 's,^[0-9]\+ ,,' | awk '{printf(\"%-45s %-s\n\", $1, substr($0,length($1)+2))}' " \
        --POPTdesc=$"list package(s) by install time, most recent first"

This is one of the reasons for 'rpm --help' showing the popt aliases in a section of their own: such aliases cannot be freely combined with other options.

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