bottle_version: handle zpython bottle.

Closes Homebrew/homebrew#28870.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Mike McQuaid 2014-05-06 18:28:46 +01:00
parent 0ac11f8026
commit 2b9c350b27
2 changed files with 9 additions and 0 deletions

View File

@ -12,6 +12,10 @@ class BottleVersion < Version
m = /-(r\d+\.?\d*)/.match(stem) m = /-(r\d+\.?\d*)/.match(stem)
return m.captures.first unless m.nil? return m.captures.first unless m.nil?
# e.g. 00-5.0.5 from zpython-00-5.0.5.mavericks.bottle.tar.gz
m = /(00-\d+\.\d+(\.\d+)+)/.match(stem)
return m.captures.first unless m.nil?
# e.g. 1.6.39 from pazpar2-1.6.39.mavericks.bottle.tar.gz # e.g. 1.6.39 from pazpar2-1.6.39.mavericks.bottle.tar.gz
m = /-(\d+\.\d+(\.\d+)+)/.match(stem) m = /-(\d+\.\d+(\.\d+)+)/.match(stem)
return m.captures.first unless m.nil? return m.captures.first unless m.nil?

View File

@ -40,4 +40,9 @@ class BottleVersionParsingTests < Test::Unit::TestCase
assert_version_detected '0_5_0', assert_version_detected '0_5_0',
'/usr/local/disco-0_5_0.mavericks.bottle.tar.gz' '/usr/local/disco-0_5_0.mavericks.bottle.tar.gz'
end end
def test_zpython_style
assert_version_detected '00-5.0.5',
'/usr/local/zpython-00-5.0.5.mavericks.bottle.tar.gz'
end
end end