Sha256: f5bffca7c3d696c502ad7c3d5f90961092746f9854d7c05f040d3366e765c710

Contents?: true

Size: 1.5 KB

Versions: 19

Compression:

Stored size: 1.5 KB

Contents

module Mac::Pkg
  include Beaker::CommandFactory

  def check_for_package(name)
    raise "Package #{name} cannot be queried on #{self}"
  end

  def install_package(name, cmdline_args = '', version = nil)
    execute("hdiutil attach #{name}.dmg")
    execute("installer -pkg /Volumes/#{name}/#{name}.pkg -target /")
  end

  def uninstall_package(name, cmdline_args = '')
    raise "Package #{name} cannot be installed on #{self}"
  end

  # Upgrade an installed package to the latest available version
  #
  # @param [String] name          The name of the package to update
  # @param [String] cmdline_args  Additional command line arguments for
  #                               the package manager
  def upgrade_package(name, cmdline_args = '')
      raise "Package #{name} cannot be upgraded on #{self}"
  end

  # Deploy configuration generated by the packaging tooling to this host.
  #
  # This method calls one of #deploy_apt_repo, #deploy_yum_repo, or
  # #deploy_zyp_repo depending on the platform of this Host.
  #
  # @note See {Beaker::DSL::Helpers::HostHelpers#deploy_package_repo} for info on
  #       params
  def deploy_package_repo(path, name, version)
    raise "Package repo cannot be deployed on #{self}; the platform is not supported"
  end

  #Examine the host system to determine the architecture
  #@return [Boolean] true if x86_64, false otherwise
  def determine_if_x86_64
    result = exec(Beaker::Command.new("uname -a | grep x86_64"), :expect_all_exit_codes => true)
    result.exit_code == 0
  end

end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
beaker-2.27.0 lib/beaker/host/mac/pkg.rb
beaker-2.26.0 lib/beaker/host/mac/pkg.rb
beaker-2.25.0 lib/beaker/host/mac/pkg.rb
beaker-2.24.0 lib/beaker/host/mac/pkg.rb
beaker-2.23.0 lib/beaker/host/mac/pkg.rb
beaker-2.22.0 lib/beaker/host/mac/pkg.rb
beaker-2.21.0 lib/beaker/host/mac/pkg.rb
beaker-2.20.0 lib/beaker/host/mac/pkg.rb
beaker-2.19.0 lib/beaker/host/mac/pkg.rb
beaker-2.18.3 lib/beaker/host/mac/pkg.rb
beaker-2.18.2 lib/beaker/host/mac/pkg.rb
beaker-2.18.1 lib/beaker/host/mac/pkg.rb
beaker-2.18.0 lib/beaker/host/mac/pkg.rb
beaker-2.17.0 lib/beaker/host/mac/pkg.rb
beaker-2.16.0 lib/beaker/host/mac/pkg.rb
beaker-2.15.1 lib/beaker/host/mac/pkg.rb
beaker-2.15.0 lib/beaker/host/mac/pkg.rb
beaker-2.14.1 lib/beaker/host/mac/pkg.rb
beaker-2.14.0 lib/beaker/host/mac/pkg.rb