aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2012-03-06 09:55:00 +0000
committerBryn M. Reeves <bmr@redhat.com>2012-11-30 17:41:09 +0000
commitc2b85c74b262898869cecd5fc4c20b0c2c73ede6 (patch)
treeec78ff21ce72c4b82b45b6e77a25ba85d8f54e46
parent329cf29a9fd8b1136837360059dbb4b9d5c41413 (diff)
downloadsos-c2b85c74b262898869cecd5fc4c20b0c2c73ede6.tar.gz
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.
-rw-r--r--sos/plugins/rpm.py7
1 files changed, 6 insertions, 1 deletions
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)