bottle_version: handle pazpar2 style.
This commit is contained in:
parent
0475dbe5cc
commit
e4f291084a
@ -9,12 +9,16 @@ class BottleVersion < Version
|
||||
|
||||
# e.g. x264-r2197.4.mavericks.bottle.tar.gz
|
||||
# e.g. lz4-r114.mavericks.bottle.tar.gz
|
||||
m = /(r\d+\.?\d*)/.match(stem)
|
||||
m = /-(r\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
|
||||
m = /-(\d+\.\d+(\.\d+)+)/.match(stem)
|
||||
return m.captures.first unless m.nil?
|
||||
|
||||
# e.g. ssh-copy-id-6.2p2.mountain_lion.bottle.tar.gz
|
||||
# e.g. icu4c-52.1.mountain_lion.bottle.tar.gz
|
||||
m = /(\d+\.(\d)+(p(\d)+)?)/.match(stem)
|
||||
m = /-(\d+\.(\d)+(p(\d)+)?)/.match(stem)
|
||||
return m.captures.first unless m.nil?
|
||||
|
||||
super
|
||||
|
||||
@ -30,4 +30,9 @@ class BottleVersionParsingTests < Test::Unit::TestCase
|
||||
assert_version_detected 'r114',
|
||||
'/usr/local/lz4-r114.mavericks.bottle.tar.gz'
|
||||
end
|
||||
|
||||
def test_pazpar2_style
|
||||
assert_version_detected '1.6.39',
|
||||
'/usr/local/pazpar2-1.6.39.mavericks.bottle.tar.gz'
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user