From b46a1ab4d5fe337588ef93a0c36f2e3dad697577 Mon Sep 17 00:00:00 2001 From: Alexander Khryukin Date: Wed, 16 Mar 2016 15:26:49 +0300 Subject: [PATCH] rpmvercmp > rpmEVRcmp, for unknown reason rpmvercmp not working in ruby --- app/models/build_list.rb | 2 +- app/models/build_list/package.rb | 4 ++-- lib/plugins/rpm.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/build_list.rb b/app/models/build_list.rb index a3007b6c0..860de1074 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -394,7 +394,7 @@ class BuildList < ActiveRecord::Base source_packages.each do |nsp| sp = last_bl.source_packages.find{ |sp| nsp.name == sp.name } return true unless sp - comparison = nsp.rpmvercmp(sp) + comparison = nsp.rpmEVRcmp(sp) return true if comparison == 1 return comparison == 0 && ( !save_to_platform.released? || save_to_platform.distrib_type == 'rhel' ) end diff --git a/app/models/build_list/package.rb b/app/models/build_list/package.rb index cafa2fdb9..cc4cb8f92 100644 --- a/app/models/build_list/package.rb +++ b/app/models/build_list/package.rb @@ -33,8 +33,8 @@ class BuildList::Package < ActiveRecord::Base # @param [BuildList::Package] other # @return [Number] -1 if +other+ is greater than, 0 if +other+ is equal to, # and +1 if other is less than version. - def rpmvercmp(other) - RPM::C.rpmvercmp to_vre_epoch_zero, other.to_vre_epoch_zero + def rpmEVRcmp(other) + RPM::C.rpmEVRcmp to_vre_epoch_zero, other.to_vre_epoch_zero end def self.by_repository(repository, &block) diff --git a/lib/plugins/rpm.rb b/lib/plugins/rpm.rb index a55fc34f8..1deb5e335 100644 --- a/lib/plugins/rpm.rb +++ b/lib/plugins/rpm.rb @@ -13,7 +13,7 @@ module RPM ) end - attach_function 'rpmvercmp', [:string, :string], :int + attach_function 'rpmEVRcmp', [:string, :string], :int end end