lib/beaker/host/unix/pkg.rb
# 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
Upgrade an installed package to the latest available version
Upgrade an installed package to the latest available version
def upgrade_package(name, cmdline_args = '', opts = {})
    case self['platform']
      when /sles-/
        execute("zypper --non-interactive --no-gpg-checks up #{name}", opts)
      when /el-4/
        @logger.debug("Package upgrade is not supported on rhel4")
      when /fedora-22/
        execute("dnf -y #{cmdline_args} update #{name}", opts)
      when /cisco|fedora|centos|eos|el-/
        execute("yum -y #{cmdline_args} update #{name}", opts)
      when /ubuntu|debian|cumulus/
        update_apt_if_needed
        execute("apt-get install -o Dpkg::Options::='--force-confold' #{cmdline_args} -y --force-yes #{name}", opts)
      when /solaris-11/
        execute("pkg #{cmdline_args} update #{name}", opts)
      when /solaris-10/
        execute("pkgutil -u -y #{cmdline_args} ${name}", opts)
      else
        raise "Package #{name} cannot be upgraded on #{self}"
    end
  end
def upgrade_package ( name , cmdline_args = '' , opts = { } ) case self [ 'platform' ] when / sles- / execute ( "zypper --non-interactive --no-gpg-checks up #{name}" , opts ) when / el-4 / @logger . debug ( "Package upgrade is not supported on rhel4" ) when / fedora-22 / execute ( "dnf -y #{cmdline_args} update #{name}" , opts ) when / cisco|fedora|centos|eos|el- / execute ( "yum -y #{cmdline_args} update #{name}" , opts ) when / ubuntu|debian|cumulus / update_apt_if_needed execute ( "apt-get install -o Dpkg::Options::='--force-confold' #{cmdline_args} -y --force-yes #{name}" , opts ) when / solaris-11 / execute ( "pkg #{cmdline_args} update #{name}" , opts ) when / solaris-10 / execute ( "pkgutil -u -y #{cmdline_args} ${name}" , opts ) else raise "Package #{name} cannot be upgraded on #{self}" end end
Upgrade an installed package to the latest available version
Upgrade an installed package to the latest available version
name
<not_specific>
cmdline_args
<not_specific>
opts
<not_specific>
<not_specific>
cmdline_args Additional command line arguments for the package manager
cmdline_args Additional command line arguments for the package manager