Skip to content

Commit

Permalink
Use Pkg.CompareVersions instead of Gem::Version
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Sep 25, 2017
1 parent cc8a115 commit 35e1281
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions package/yast2-packager.spec
Expand Up @@ -39,20 +39,17 @@ BuildRequires: yast2 >= 3.2.7
# needed for icon for desktop file, it is verified at the end of build
BuildRequires: yast2_theme

# Pkg::PrdGetLicenseToConfirm Pkg::PrdMarkLicenseConfirmed
# Pkg::PrdMarkLicenseNotConfirmed Pkg::PrdHasLicenseConfirmed
# Pkg::PrdNeedToAcceptLicense
BuildRequires: yast2-pkg-bindings >= 3.3.2
# Pkg::CompareVersions
BuildRequires: yast2-pkg-bindings >= 4.0.1

# Augeas lenses
BuildRequires: augeas-lenses

# Newly added RPM
Requires: yast2-country-data >= 2.16.3

# Pkg::PrdGetLicenseToConfirm Pkg::PrdMarkLicenseConfirmed
# Pkg::PrdNeedToAcceptLicense Pkg::PrdHasLicenseConfirmed
Requires: yast2-pkg-bindings >= 3.3.1
# Pkg::CompareVersions
Requires: yast2-pkg-bindings >= 4.0.1

# Optional resolvables support in PackagesProposal
Requires: yast2 >= 3.2.7
Expand Down
2 changes: 1 addition & 1 deletion src/lib/y2packager/release_notes_rpm_reader.rb
Expand Up @@ -103,7 +103,7 @@ def find_package(name)
Y2Packager::Package
.find(name)
.select { |i| AVAILABLE_STATUSES.include?(i.status) }
.sort_by { |i| Gem::Version.new(i.version) }
.sort { |a, b| Yast::Pkg.CompareVersions(a.version, b.version) }
.last
end

Expand Down

0 comments on commit 35e1281

Please sign in to comment.