class Cfgd::Adapter::APT

Pkgmanager class for debian

Constants

APT_ARGS
APT_BIN
APT_INSTALL_ARGS
APT_REMOVE_ARGS
APT_UPDATE_ARGS
APT_UPGRADE_ARGS
DPKG_BIN
DPKG_INFO_ARGS
SHELL_ENV

Public Class Methods

install_single(name) click to toggle source
# File lib/adapter/pkgmanager/apt.rb, line 24
def self.install_single(name)
  cmd = "#{SHELL_ENV} #{APT_BIN} #{APT_INSTALL_ARGS} #{APT_ARGS} #{name}"
  _stdout, _stderr, status = Open3.capture3(cmd)
  status.exitstatus.shellexit
end
installed?(name) click to toggle source
# File lib/adapter/pkgmanager/apt.rb, line 30
def self.installed?(name)
  cmd = "#{SHELL_ENV} #{DPKG_BIN} #{DPKG_INFO_ARGS} #{name}"
  _stdout, _stderr, status = Open3.capture3(cmd)
  status.exitstatus.shellexit
end
remove_single(name) click to toggle source
# File lib/adapter/pkgmanager/apt.rb, line 36
def self.remove_single(name)
  cmd = "#{SHELL_ENV} #{APT_BIN} #{APT_REMOVE_ARGS} #{APT_ARGS} #{name}"
  _stdout, _stderr, status = Open3.capture3(cmd)
  status.exitstatus.shellexit
end
supports_os?(os) click to toggle source
# File lib/adapter/pkgmanager/apt.rb, line 11
def self.supports_os?(os)
  true if os.eql? 'debian'
end