From 27d2a95e8fbf1819fd872fdde191bea2800a77e4 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Wed, 21 Sep 2011 17:14:54 -0500 Subject: [PATCH] Correctly parse ImageMagick bottle version Commit 2695821e98 ("Only use the bottle if its version is up-to-date") essentially broke the ImageMagick bottle, because the version parsing logic returns "1" as the bottle version. Fixing this requires only a slight modification to the bottle URL regex; includes a test. Signed-off-by: Jack Nagel --- Library/Homebrew/extend/pathname.rb | 2 +- Library/Homebrew/test/test_versions.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 2f23af7e56..095a0aa1ac 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -165,7 +165,7 @@ class Pathname return $1 if $1 # brew bottle style e.g. qt-4.7.3-bottle.tar.gz - /-((\d+\.)*\d+)-bottle$/.match stem + /-((\d+\.)*\d+(-\d)*)-bottle$/.match stem return $1 if $1 # eg. otp_src_R13B (this is erlang's style) diff --git a/Library/Homebrew/test/test_versions.rb b/Library/Homebrew/test/test_versions.rb index 1febdab0a0..5714c4b66e 100644 --- a/Library/Homebrew/test/test_versions.rb +++ b/Library/Homebrew/test/test_versions.rb @@ -164,4 +164,9 @@ class VersionTests < Test::Unit::TestCase check 'https://downloads.sourceforge.net/project/machomebrew/Bottles/qt-4.7.3-bottle.tar.gz', '4.7.3' end + + def test_imagemagick_bottle_style + check 'http://downloads.sf.net/project/machomebrew/Bottles/imagemagick-6.7.1-1-bottle.tar.gz', + '6.7.1-1' + end end