Method: FreeBSD::Pkg#install_package

Defined in:
lib/beaker/host/freebsd/pkg.rb

#install_package(package, cmdline_args = nil, opts = {}) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/beaker/host/freebsd/pkg.rb', line 19

def install_package(package, cmdline_args = nil, opts = {})
  cmd = if pkgng_active?
          "pkg install #{cmdline_args || '-y'} #{package}"
        else
          "pkg_add #{cmdline_args || '-r'} #{package}"
        end
  execute(cmd, opts) { |result| result }
end