From 98c3d39e655881c79f485c599902722180068df9 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sat, 3 Aug 2013 20:03:58 -0700 Subject: [PATCH] bottle_versions: add ssh_copy_id bottle detection. --- Library/Homebrew/bottle_version.rb | 4 ++++ Library/Homebrew/test/test_bottle_versions.rb | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/Library/Homebrew/bottle_version.rb b/Library/Homebrew/bottle_version.rb index 9da0bf3e3b..4778632970 100644 --- a/Library/Homebrew/bottle_version.rb +++ b/Library/Homebrew/bottle_version.rb @@ -7,6 +7,10 @@ class BottleVersion < Version m = /-([\d\.]+-x86(_64)?)/.match(stem) return m.captures.first unless m.nil? + # e.g. ssh-copy-id-6.2p2.bottle.tar.gz + m = /(\d\.(\d)+(p(\d)+)?)/.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 d1cd002ca0..b0b061d679 100644 --- a/Library/Homebrew/test/test_bottle_versions.rb +++ b/Library/Homebrew/test/test_bottle_versions.rb @@ -10,4 +10,9 @@ class BottleVersionParsingTests < Test::Unit::TestCase assert_version_detected '2013.1.610569-x86_64', '/usr/local/perforce-2013.1.610569-x86_64.mountain_lion.bottle.tar.gz' end + + def test_ssh_copy_id_style + assert_version_detected '6.2p2', + '/usr/local/ssh-copy-id-6.2p2.mountain_lion.bottle.tar.gz' + end end