Class: LinuxAdmin::Rpm

Inherits:
LinuxAdmin show all
Defined in:
lib/linux_admin/rpm.rb

Constant Summary

Constants inherited from LinuxAdmin

VERSION

Class Method Summary collapse

Methods included from Common

#cmd, #run

Class Method Details

.list_installedObject



3
4
5
6
7
8
9
# File 'lib/linux_admin/rpm.rb', line 3

def self.list_installed
  out = run("rpm -qa --qf \"%{NAME} %{VERSION}-%{RELEASE}\n\"", :return_output => true)
  out.split("\n").each_with_object({}) do |line, pkg_hash|
    name, ver = line.split(" ")
    pkg_hash[name] = ver
  end
end