Sha256: b95599e3c8794e14da24ab7efbc8049f0431d5073f6fe417f1ff1626d51c441d

Contents?: true

Size: 1.02 KB

Versions: 515

Compression:

Stored size: 1.02 KB

Contents

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 :osfamily => :redhat, :lsbdistrelease => ["2.1", "3", "4"]

  confine    :osfamily => :redhat

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

    unless self.query
      raise Puppet::ExecutionFailure.new(
        _("Could not find package %{name}") % { name: self.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+/
      return $1
    else
      # up2date didn't find updates, pretend the current
      # version is the latest
      return @property_hash[:ensure]
    end
  end

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

Version data entries

515 entries across 515 versions & 2 rubygems

Version Path
puppet-7.17.0 lib/puppet/provider/package/up2date.rb
puppet-7.17.0-x86-mingw32 lib/puppet/provider/package/up2date.rb
puppet-7.17.0-x64-mingw32 lib/puppet/provider/package/up2date.rb
puppet-7.17.0-universal-darwin lib/puppet/provider/package/up2date.rb
puppet-6.27.0 lib/puppet/provider/package/up2date.rb
puppet-6.27.0-x86-mingw32 lib/puppet/provider/package/up2date.rb
puppet-6.27.0-x64-mingw32 lib/puppet/provider/package/up2date.rb
puppet-6.27.0-universal-darwin lib/puppet/provider/package/up2date.rb
puppet-7.16.0 lib/puppet/provider/package/up2date.rb
puppet-7.16.0-x86-mingw32 lib/puppet/provider/package/up2date.rb
puppet-7.16.0-x64-mingw32 lib/puppet/provider/package/up2date.rb
puppet-7.16.0-universal-darwin lib/puppet/provider/package/up2date.rb
puppet-7.15.0 lib/puppet/provider/package/up2date.rb
puppet-7.15.0-x86-mingw32 lib/puppet/provider/package/up2date.rb
puppet-7.15.0-x64-mingw32 lib/puppet/provider/package/up2date.rb
puppet-7.15.0-universal-darwin lib/puppet/provider/package/up2date.rb
puppet-6.26.0 lib/puppet/provider/package/up2date.rb
puppet-6.26.0-x86-mingw32 lib/puppet/provider/package/up2date.rb
puppet-6.26.0-x64-mingw32 lib/puppet/provider/package/up2date.rb
puppet-6.26.0-universal-darwin lib/puppet/provider/package/up2date.rb