Project

General

Profile

« Previous | Next » 

Revision 8b5fca79

Added by Marc Dequènes almost 15 years ago

  • ID 8b5fca79c2b8af3cde12b3370df861393aaa6bc6

[fix] improved version parsing check again (in case parsing fail of gives empty result) and check if @upstream is empty in resolt (as a manual modification could render the version unusuable)

View differences:

lib/debian/version.rb
@revision = nil
else
@upstream = Debian_apt.debVS.upstream_version(version)
@epoch, @revision = version.split(@upstream, 2)
@epoch = @epoch ? @epoch[0..-2].to_i : 0
@revision = @revision[1..-1] if @revision
if @upstream == ""
@epoch = 0
@upstream = nil
@revision = nil
else
@epoch, @revision = version.split(@upstream, 2)
@epoch = @epoch ? @epoch[0..-2].to_i : 0
@revision = @revision[1..-1] if @revision
end
# magic fence
raise "DebianVersion bug in parsing. Stopping before breaking the world !" if self.version != version
raise "DebianVersion bug in parsing. Stopping before breaking the world ! (given version was: '#{version}', result was: '#{self.version}')" if self.version != version
end
end
def version
if @upstream.nil?
if @upstream.nil? or @upstream == ""
ver = nil
else
ver = "#{@upstream}"

Also available in: Unified diff