Class: Evesync::OS::Rpm

Inherits:
Object
  • Object
show all
Includes:
BasePackageManager
Defined in:
lib/evesync/os/linux/rhel/rpm.rb

Overview

Rpm packages changes watcher. Yum history makes it difficult to handler package removals. So, rpm is the only tool that show all packages in the system. This class handles packages changes.

Example:

rpm = Evesync::Rpm.new
sleep 1000
rpm.changed.each do |package|
  p package # print packages that changed
end

TODO:

* add reinstall handling also

Instance Method Summary collapse

Methods included from BasePackageManager

#changes, #initialize

Instance Method Details

#make_pkg_snapshotObject



29
30
31
32
33
34
35
36
37
38
# File 'lib/evesync/os/linux/rhel/rpm.rb', line 29

def make_pkg_snapshot
  snapshot = {}
  query_output = `#{PKG_QUERY}`
  query_output.lines.each do |line|
    info = line.split
    snapshot[info[0]] = info[1]
  end

  snapshot
end