Class: Y2Packager::ReleaseNotesFetchers::Rpm

Inherits:
Base
  • Object
show all
Defined in:
library/packages/src/lib/y2packager/release_notes_fetchers/rpm.rb

Overview

This class is able to read release notes from a RPM package

Release notes for a product are available in a specific package which provides “release-notes()” for the given product. For instance, a package which provides “release-notes() = SLES” will provide release notes for the SLES product.

If more than one product provide release notes for that product, the first one in alphabetical order will be selected.

This reader takes care of downloading the release notes package (if any), extracting its content and returning release notes for a given language/format.

See Also:

Instance Attribute Summary

Attributes inherited from Base

#product

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Y2Packager::ReleaseNotesFetchers::Base

Instance Method Details

#latest_versionString, :none

Return release notes latest version identifier

Examples:

Getting release notes version

reader = ReleaseNotesFetchers::Rpm.new(product)
reader.latest_version # => "15.0"

Not defined product

reader = ReleaseNotesFetchers::Rpm.new(product)
reader.latest_version # => :none

Returns:

  • (String, :none)

    Package version; :none if no release notes package was found.



75
76
77
78
# File 'library/packages/src/lib/y2packager/release_notes_fetchers/rpm.rb', line 75

def latest_version
  return :none if release_notes_package.nil?
  release_notes_package.version
end

#release_notes(prefs) ⇒ String?

Get release notes for the given product

Release notes are downloaded and extracted to work directory. When release notes for a language “xx_XX” are not found, it will fallback to “xx”.

Parameters:

Returns:

  • (String, nil)

    Release notes or nil if a release notes were not found (no package providing release notes or notes not found in the package)



50
51
52
53
54
55
56
57
58
59
60
61
# File 'library/packages/src/lib/y2packager/release_notes_fetchers/rpm.rb', line 50

def release_notes(prefs)
  if release_notes_package.nil?
    log.info "No package containing release notes for #{product.name} was found"
    return nil
  end

  relnotes = extract_release_notes(prefs)
  log.info "Got release notes for #{product.name} from RPM " \
    "#{release_notes_package.name} #{release_notes_package.version} " \
    "with #{prefs}"
  relnotes
end