Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 455096 - add %{INSTALLTIME:date} to the --qf flags when collecting installed-rpms
Summary: add %{INSTALLTIME:date} to the --qf flags when collecting installed-rpms
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: sos
Version: 5.2
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Adam Stokes
QA Contact:
Depends On:
Blocks: 455280 455920
TreeView+ depends on / blocked
Reported: 2008-07-11 22:16 UTC by Chris Marcantonio
Modified: 2009-01-20 21:42 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2009-01-20 21:42:23 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:0171 normal SHIPPED_LIVE sosreport bug fix and enhancement update 2009-01-20 16:05:38 UTC

Description Chris Marcantonio 2008-07-11 22:16:05 UTC
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/    2008-07-10
18:01:07.000000000 -0400
+++ /usr/lib/python2.4/site-packages/sos/plugins/ 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)

Comment 1 Chris Marcantonio 2008-07-11 22:24:13 UTC
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-07-14 17:02:42 UTC
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 9 errata-xmlrpc 2009-01-20 21:42:23 UTC
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.