Skip to content
Snippets Groups Projects
Commit 7d61bfe8 authored by Mike McQuaid's avatar Mike McQuaid
Browse files

Add another Erlang version format.

parent 5ce1caa1
No related branches found
No related tags found
No related merge requests found
......@@ -97,6 +97,10 @@ class VersionParsingTests < Test::Unit::TestCase
assert_version_detected 'R15B01', 'https://github.com/erlang/otp/tarball/OTP_R15B01'
end
def test_yet_another_erlang_version_style
assert_version_detected 'R15B03-1', 'https://github.com/erlang/otp/tarball/OTP_R15B03-1'
end
def test_p7zip_version_style
assert_version_detected '9.04',
'http://kent.dl.sourceforge.net/sourceforge/p7zip/p7zip_9.04_src_all.tar.bz2'
......@@ -211,6 +215,10 @@ class VersionParsingTests < Test::Unit::TestCase
assert_version_detected 'R15B01', 'https://downloads.sf.net/project/machomebrew/Bottles/erlang-R15B01.mountainlion.bottle.tar.gz'
end
def test_yet_another_erlang_bottle_style
assert_version_detected 'R15B03-1', 'https://downloads.sf.net/project/machomebrew/Bottles/erlang-R15B03-1.mountainlion.bottle.tar.gz'
end
def test_old_bottle_style
assert_version_detected '4.7.3', 'https://downloads.sf.net/project/machomebrew/Bottles/qt-4.7.3-bottle.tar.gz'
end
......
......@@ -128,7 +128,7 @@ class Version
return m.captures.first unless m.nil?
# e.g. https://github.com/erlang/otp/tarball/OTP_R15B01 (erlang style)
m = /[-_](R\d+[AB]\d*)/.match(spec.to_s)
m = /[-_](R\d+[AB]\d*(-\d+)?)/.match(spec.to_s)
return m.captures.first unless m.nil?
# e.g. boost_1_39_0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment