Bug 455280 - add %{INSTALLTIME:date} to the --qf flags when collecting installed-rpms
add %{INSTALLTIME:date} to the --qf flags when collecting installed-rpms
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: sos (Show other bugs)
All Linux
urgent Severity low
: rc
: ---
Assigned To: Adam Stokes
: ZStream
Depends On: 455096
Blocks: 467444 469012 469013
  Show dependency treegraph
Reported: 2008-07-14 12:43 EDT by Robert Jackson
Modified: 2015-02-24 17:56 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-05-18 16:23:23 EDT
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 Robert Jackson 2008-07-14 12:43:40 EDT
+++ This bug was initially created as a clone of Bug #455096 +++

Description of problem:

Sosreport currently collects installed-rpms using --qf to collect full
information about package name, version, release, and arch.  It would seem
useful in certain cases to be able to see the install date for each package and
is a minimally invasive change to simply include %{INSTALLTIME:date} in the list
of flags to collect.

The only unfortunate outcome of adding this is that it makes the raw output from
the rpm command a bit ugly, so piping to awk to clean up the output seems to be
the best solution.

Sample output looks like this:

termcap-5.5-1.20060701.1-noarch                             Mon 31 Mar 2008
05:23:37 PM EDT
libjpeg-6b-37-x86_64                                        Mon 31 Mar 2008
05:23:54 PM EDT
gawk-3.1.5-14.el5-x86_64                                    Mon 31 Mar 2008
05:24:02 PM EDT
libgpg-error-1.4-2-x86_64                                   Mon 31 Mar 2008
05:24:06 PM EDT
libcap-1.10-26-x86_64                                       Mon 31 Mar 2008
05:24:07 PM EDT
gdbm-1.8.0-26.2.1-x86_64                                    Mon 31 Mar 2008
05:24:24 PM EDT
libieee1284-0.2.9-4.el5-x86_64                              Mon 31 Mar 2008
05:24:30 PM EDT
gamin-0.1.7-8.el5-x86_64                                    Mon 31 Mar 2008
05:24:31 PM EDT
mkisofs-2.01-10-x86_64                                      Mon 31 Mar 2008
05:24:32 PM EDT
libmng-1.0.9-5.1-x86_64                                     Mon 31 Mar 2008
05:24:36 PM EDT
less-394-5.el5-x86_64                                       Mon 31 Mar 2008
05:24:37 PM EDT
libsysfs-2.0.0-6-x86_64                                     Mon 31 Mar 2008
05:24:40 PM EDT
cdparanoia-alpha9.8-27.2-x86_64                             Mon 31 Mar 2008
05:24:41 PM EDT

...and so on.

My change (on sos-1.7-9.2.el5) looks something like this:

--- /usr/lib/python2.4/site-packages/sos/plugins/rpm.py.ORIG    2008-07-10
18:01:07.000000000 -0400
+++ /usr/lib/python2.4/site-packages/sos/plugins/rpm.py 2008-07-11
18:09:52.000000000 -0400
@@ -24,7 +24,7 @@

         if self.isOptionEnabled("rpmq"):
-          self.collectExtOutput("/bin/rpm -qa --qf
\"%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH}\n\"", root_symlink = "installed-rpms")
+          self.collectExtOutput("/bin/rpm -qa
-F ~~ '{printf \"%-60s%s\\n\",$1,$2}'", root_symlink = "installed-rpms")

         if self.isOptionEnabled("rpmva"):
           self.eta_weight += 800 # this plugins takes 200x longer (for ETA)

-- Additional comment from cmarcant@redhat.com on 2008-07-11 18:24 EST --
Of course, the line wrap in the comment above makes the output look a bit ugly,
which is the only downside I see to the proposed change.  With a sufficiently
wide display, the output cleans up nicely.  In its current form, output is about
91 characters wide...we can certainly adjust the field widths in the awk to make
it fit smaller screens a bit better, if need be. (with the only risk being
collisions of the first field into the second with a sufficiently long rpm name)
Comment 2 RHEL Product and Program Management 2008-09-05 13:25:37 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 12 errata-xmlrpc 2009-05-18 16:23:23 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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