From c2b85c74b262898869cecd5fc4c20b0c2c73ede6 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Tue, 6 Mar 2012 09:55:00 +0000 Subject: Fix installed-rpms command Fix the formatting of rpm -q output to ensure that long package do not overflow into the following column and quote tilde chars passed to the shell to prevent user home directory expansion side-effects. --- sos/plugins/rpm.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sos/plugins/rpm.py b/sos/plugins/rpm.py index 511f64ca..7e500736 100644 --- a/sos/plugins/rpm.py +++ b/sos/plugins/rpm.py @@ -24,7 +24,12 @@ class rpm(Plugin, RedHatPlugin): self.addCopySpec("/var/log/rpmpkgs") if self.getOption("rpmq"): - self.collectExtOutput("/bin/rpm -qa --qf=\"%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}~~%{INSTALLTIME:date}\t%{INSTALLTIME}\t%{VENDOR}\n\" --nosignature --nodigest|/bin/awk -F ~~ '{printf \"%-60s%s\\n\",$1,$2}'|sort", root_symlink = "installed-rpms") + self.collectExtOutput("/bin/rpm -qa --qf=" + "\"%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}~~" + "%{INSTALLTIME:date}\t%{INSTALLTIME}\t%{VENDOR}\n\"" + " --nosignature --nodigest | /bin/awk -F '~~' " + "'{printf \"%-59s %s\\n\",$1,$2}'|sort", + root_symlink = "installed-rpms") if self.getOption("rpmva"): self.collectExtOutput("/bin/rpm -Va", root_symlink = "rpm-Va", timeout = 3600) -- cgit