Sha256: 4ba9c1ad6738446ed8ecda23dd6763e5af27e496b48aaf177e953043636f9e23

Contents?: true

Size: 1.04 KB

Versions: 20

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true

Puppet::Type.type(:package).provide :up2date, :parent => :rpm, :source => :rpm do
  desc "Support for Red Hat's proprietary `up2date` package update
    mechanism."

  commands :up2date => "/usr/sbin/up2date-nox"

  defaultfor 'os.family' => :redhat, 'os.distro.release.full' => ["2.1", "3", "4"]

  confine    'os.family' => :redhat

  # Install a package using 'up2date'.
  def install
    up2date "-u", @resource[:name]

    unless query
      raise Puppet::ExecutionFailure, _("Could not find package %{name}") % { name: name }
    end
  end

  # What's the latest package version available?
  def latest
    # up2date can only get a list of *all* available packages?
    output = up2date "--showall"

    if output =~ /^#{Regexp.escape @resource[:name]}-(\d+.*)\.\w+/
      Regexp.last_match(1)
    else
      # up2date didn't find updates, pretend the current
      # version is the latest
      @property_hash[:ensure]
    end
  end

  def update
    # Install in up2date can be used for update, too
    install
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
puppet-8.10.0 lib/puppet/provider/package/up2date.rb
puppet-8.10.0-x86-mingw32 lib/puppet/provider/package/up2date.rb
puppet-8.10.0-x64-mingw32 lib/puppet/provider/package/up2date.rb
puppet-8.10.0-universal-darwin lib/puppet/provider/package/up2date.rb
puppet-8.9.0 lib/puppet/provider/package/up2date.rb
puppet-8.9.0-x86-mingw32 lib/puppet/provider/package/up2date.rb
puppet-8.9.0-x64-mingw32 lib/puppet/provider/package/up2date.rb
puppet-8.9.0-universal-darwin lib/puppet/provider/package/up2date.rb
puppet-8.8.1 lib/puppet/provider/package/up2date.rb
puppet-8.8.1-x86-mingw32 lib/puppet/provider/package/up2date.rb
puppet-8.8.1-x64-mingw32 lib/puppet/provider/package/up2date.rb
puppet-8.8.1-universal-darwin lib/puppet/provider/package/up2date.rb
puppet-8.7.0 lib/puppet/provider/package/up2date.rb
puppet-8.7.0-x86-mingw32 lib/puppet/provider/package/up2date.rb
puppet-8.7.0-x64-mingw32 lib/puppet/provider/package/up2date.rb
puppet-8.7.0-universal-darwin lib/puppet/provider/package/up2date.rb
puppet-8.6.0 lib/puppet/provider/package/up2date.rb
puppet-8.6.0-x86-mingw32 lib/puppet/provider/package/up2date.rb
puppet-8.6.0-x64-mingw32 lib/puppet/provider/package/up2date.rb
puppet-8.6.0-universal-darwin lib/puppet/provider/package/up2date.rb