class Evesync::OS::Rpm
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
Constants
- PKG_QUERY
Query for rpm list
Public Instance Methods
make_pkg_snapshot()
click to toggle source
# 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