bottle_version: parse disco bottle versions.

This commit is contained in:
Mike McQuaid 2014-05-01 17:18:44 +01:00
parent 2fb6d2fdbe
commit 0ac11f8026
2 changed files with 9 additions and 0 deletions

View File

@ -21,6 +21,10 @@ class BottleVersion < Version
m = /-(\d+\.(\d)+(p(\d)+)?)/.match(stem)
return m.captures.first unless m.nil?
# e.g. 0_5_0 from disco-0_5_0.mavericks.bottle.tar.gz
m = /-(\d+_\d+(_\d+)+)/.match(stem)
return m.captures.first unless m.nil?
super
end
end

View File

@ -35,4 +35,9 @@ class BottleVersionParsingTests < Test::Unit::TestCase
assert_version_detected '1.6.39',
'/usr/local/pazpar2-1.6.39.mavericks.bottle.tar.gz'
end
def test_disco_style
assert_version_detected '0_5_0',
'/usr/local/disco-0_5_0.mavericks.bottle.tar.gz'
end
end