7eb9d00360
Making use of the apt-check command from the 'update-notifier-common' package (if available) display the number of available updates, number of security updates as well as the update package names.
13 lines
390 B
Ruby
13 lines
390 B
Ruby
Facter.add("apt_package_updates") do
|
|
confine :osfamily => 'Debian'
|
|
setcode do
|
|
if File.executable?("/usr/lib/update-notifier/apt-check")
|
|
packages = Facter::Util::Resolution.exec('/usr/lib/update-notifier/apt-check -p 2>&1')
|
|
packages = packages.split("\n")
|
|
if Facter.version < '2.0.0'
|
|
packages = packages.join(',')
|
|
end
|
|
packages
|
|
end
|
|
end
|
|
end
|