mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
erlang: fix version detection and bottles.
This commit is contained in:
parent
9e8bf8413d
commit
d9a18d4c1e
@ -93,6 +93,10 @@ class VersionParsingTests < Test::Unit::TestCase
|
||||
assert_version_detected 'R13B', 'http://erlang.org/download/otp_src_R13B.tar.gz'
|
||||
end
|
||||
|
||||
def test_another_erlang_version_style
|
||||
assert_version_detected 'R15B01', 'https://github.com/erlang/otp/tarball/OTP_R15B01'
|
||||
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'
|
||||
@ -203,6 +207,10 @@ class VersionParsingTests < Test::Unit::TestCase
|
||||
assert_version_detected 'R15B', 'https://downloads.sf.net/project/machomebrew/Bottles/erlang-R15B.lion.bottle.tar.gz'
|
||||
end
|
||||
|
||||
def test_another_erlang_bottle_style
|
||||
assert_version_detected 'R15B01', 'https://downloads.sf.net/project/machomebrew/Bottles/erlang-R15B01.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
|
||||
|
@ -127,6 +127,10 @@ class Version
|
||||
m = %r[github.com/.+/(?:zip|tar)ball/v?((\d+\.)+\d+_(\d+))$].match(spec.to_s)
|
||||
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)
|
||||
return m.captures.first unless m.nil?
|
||||
|
||||
# e.g. boost_1_39_0
|
||||
m = /((\d+_)+\d+)$/.match(stem)
|
||||
return m.captures.first.gsub('_', '.') unless m.nil?
|
||||
@ -164,14 +168,10 @@ class Version
|
||||
m = /_((\d+\.)+\d+[abc]?)[.]orig$/.match(stem)
|
||||
return m.captures.first unless m.nil?
|
||||
|
||||
# e.g. erlang-R14B03-bottle.tar.gz (old erlang bottle style)
|
||||
# e.g. http://www.openssl.org/source/openssl-0.9.8s.tar.gz
|
||||
m = /-([^-]+)/.match(stem)
|
||||
return m.captures.first unless m.nil?
|
||||
|
||||
# e.g. opt_src_R13B (erlang)
|
||||
m = /otp_src_(.+)/.match(stem)
|
||||
return m.captures.first unless m.nil?
|
||||
|
||||
# e.g. astyle_1.23_macosx.tar.gz
|
||||
m = /_([^_]+)/.match(stem)
|
||||
return m.captures.first unless m.nil?
|
||||
|
Loading…
x
Reference in New Issue
Block a user