summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElan Ruusamäe <glen@delfi.ee>2016-05-12 18:37:19 +0300
committerElan Ruusamäe <glen@delfi.ee>2016-05-12 18:37:19 +0300
commit8a602446bd9067a4b541d9d146bbb4ade77f1a5d (patch)
treea1c2187bf2f7f43dd475f49b2f32f839e8abd7eb
parentceb552d23e4974371f97315440b0bea4455cecff (diff)
downloadohai-8a602446bd9067a4b541d9d146bbb4ade77f1a5d.tar.gz
add installdate for rpm packages, unix timestamp
-rw-r--r--lib/ohai/plugins/packages.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ohai/plugins/packages.rb b/lib/ohai/plugins/packages.rb
index f39e1a60..5f48327b 100644
--- a/lib/ohai/plugins/packages.rb
+++ b/lib/ohai/plugins/packages.rb
@@ -41,13 +41,13 @@ Ohai.plugin(:Packages) do
elsif %w{rhel fedora suse pld}.include? platform_family
require "shellwords"
- format = Shellwords.escape '%{NAME}\t%|EPOCH?{%{EPOCH}}:{0}|\t%{VERSION}\t%{RELEASE}\t%{ARCH}\n'
+ format = Shellwords.escape '%{NAME}\t%|EPOCH?{%{EPOCH}}:{0}|\t%{VERSION}\t%{RELEASE}\t%{INSTALLTIME}\t%{ARCH}\n'
so = shell_out("rpm -qa --queryformat #{format}")
pkgs = so.stdout.lines
pkgs.each do |pkg|
- name, epoch, version, release, arch = pkg.split
- packages[name] = { "epoch" => epoch, "version" => version, "release" => release, "arch" => arch }
+ name, epoch, version, release, installdate, arch = pkg.split
+ packages[name] = { "epoch" => epoch, "version" => version, "release" => release, "installdate" => installdate, "arch" => arch }
end
end
end