Class: Plat4m::Sniffer::Linux::Zypper

Inherits:
NixManager show all
Defined in:
lib/plat4m/sniff/linux.rb

Instance Method Summary collapse

Methods inherited from NixManager

#initialize, #make_install_command, #make_uninstall_command

Methods inherited from PkgManager

#has_sudo?, #initialize, #install, #is_root?, #make_install_command, #make_uninstall_command, #select_available, #select_uninstalled, #uninstall

Constructor Details

This class inherits a constructor from Plat4m::Sniffer::Linux::NixManager

Instance Method Details

#available?(pkg) ⇒ Boolean

Returns:

  • (Boolean)


215
216
217
# File 'lib/plat4m/sniff/linux.rb', line 215

def available?(pkg)
  system("zypper -x -t package #{pkg} >/dev/null 2>&1")
end

#installed?(pkg) ⇒ Boolean

Returns:

  • (Boolean)


211
212
213
# File 'lib/plat4m/sniff/linux.rb', line 211

def installed?(pkg)
  system("rpm -q --whatprovides #{pkg} >/dev/null 2>&1")
end