rpmvercmp > rpmEVRcmp, for unknown reason rpmvercmp not working in ruby

This commit is contained in:
Alexander Khryukin 2016-03-16 15:26:49 +03:00
parent b8841e78c7
commit b46a1ab4d5
3 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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)

View File

@ -13,7 +13,7 @@ module RPM
)
end
attach_function 'rpmvercmp', [:string, :string], :int
attach_function 'rpmEVRcmp', [:string, :string], :int
end
end