diff --git a/Library/Homebrew/bottle_version.rb b/Library/Homebrew/bottle_version.rb index 6ad8ebeb7d..9da0bf3e3b 100644 --- a/Library/Homebrew/bottle_version.rb +++ b/Library/Homebrew/bottle_version.rb @@ -3,6 +3,10 @@ class BottleVersion < Version spec = Pathname.new(spec) unless spec.is_a? Pathname stem = spec.stem + # e.g. perforce-2013.1.610569-x86_64 + m = /-([\d\.]+-x86(_64)?)/.match(stem) + return m.captures.first unless m.nil? + super end end diff --git a/Library/Homebrew/test/test_bottle_versions.rb b/Library/Homebrew/test/test_bottle_versions.rb index f418912b7e..d1cd002ca0 100644 --- a/Library/Homebrew/test/test_bottle_versions.rb +++ b/Library/Homebrew/test/test_bottle_versions.rb @@ -5,4 +5,9 @@ class BottleVersionParsingTests < Test::Unit::TestCase def assert_version_detected expected, path assert_equal expected, BottleVersion.parse(path).to_s end + + def test_perforce_style + assert_version_detected '2013.1.610569-x86_64', + '/usr/local/perforce-2013.1.610569-x86_64.mountain_lion.bottle.tar.gz' + end end