aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/bottle_version.rb4
-rw-r--r--Library/Homebrew/test/test_bottle_versions.rb5
2 files changed, 9 insertions, 0 deletions
diff --git a/Library/Homebrew/bottle_version.rb b/Library/Homebrew/bottle_version.rb
index 592105086..de210e12b 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. 5-20150215 from gcc5-5-20150215.yosemite.bottle.tar.gz
+ m = /[a-z]{3}\d-(\d{1}-\d{8})/.match(stem)
+ return m.captures.first unless m.nil?
+
# e.g. perforce-2013.1.610569-x86_64.mountain_lion.bottle.tar.gz
m = /-([\d\.]+-x86(_64)?)/.match(stem)
return m.captures.first unless m.nil?
diff --git a/Library/Homebrew/test/test_bottle_versions.rb b/Library/Homebrew/test/test_bottle_versions.rb
index 3e2374e67..1ba8ba5d9 100644
--- a/Library/Homebrew/test/test_bottle_versions.rb
+++ b/Library/Homebrew/test/test_bottle_versions.rb
@@ -80,4 +80,9 @@ class BottleVersionParsingTests < Homebrew::TestCase
assert_version_detected '11-062',
'apparix-11-062.yosemite.bottle.tar.gz'
end
+
+ def test_gcc_versions_style
+ assert_version_detected '5-20150215',
+ 'gcc5-5-20150215.yosemite.bottle.tar.gz'
+ end
end