bottle_version: add erlang versions style regex.

This commit is contained in:
Mike McQuaid 2015-03-15 16:29:21 +00:00
parent d35f960fe1
commit 6b58107693
2 changed files with 9 additions and 0 deletions

View File

@ -7,6 +7,10 @@ class BottleVersion < Version
m = /-([\d\.]+-x86(_64)?)/.match(stem) m = /-([\d\.]+-x86(_64)?)/.match(stem)
return m.captures.first unless m.nil? return m.captures.first unless m.nil?
# e.g. R14B04 from erlang-r14-R14B04.yosemite.bottle.tar.gz
m = /erlang-r\d+-(R\d+B\d+(-\d)?)/.match(stem)
return m.captures.first unless m.nil?
# e.g. x264-r2197.4.mavericks.bottle.tar.gz # e.g. x264-r2197.4.mavericks.bottle.tar.gz
# e.g. lz4-r114.mavericks.bottle.tar.gz # e.g. lz4-r114.mavericks.bottle.tar.gz
m = /-(r\d+\.?\d*)/.match(stem) m = /-(r\d+\.?\d*)/.match(stem)

View File

@ -56,6 +56,11 @@ class BottleVersionParsingTests < Homebrew::TestCase
'erlang-R16B03-1.mavericks.bottle.2.tar.gz' 'erlang-R16B03-1.mavericks.bottle.2.tar.gz'
end end
def test_erlang_versions_style
assert_version_detected 'R14B04',
'erlang-r14-R14B04.yosemite.bottle.tar.gz'
end
def test_libpano_style def test_libpano_style
assert_version_detected '13-2.9.19', assert_version_detected '13-2.9.19',
'libpano-13-2.9.19_1.yosemite.bottle.tar.gz' 'libpano-13-2.9.19_1.yosemite.bottle.tar.gz'