Bug 962846 - --last does not honor --qf
Summary: --last does not honor --qf
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-14 14:53 UTC by Need Real Name
Modified: 2013-05-15 05:06 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-05-15 05:06:21 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Need Real Name 2013-05-14 14:53:24 UTC
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 05:06:21 UTC
--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.