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 <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2011-09-21 17:14:54 -05:00
parent 51f010ac39
commit 27d2a95e8f
2 changed files with 6 additions and 1 deletions

View File

@ -165,7 +165,7 @@ class Pathname
return $1 if $1 return $1 if $1
# brew bottle style e.g. qt-4.7.3-bottle.tar.gz # 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 return $1 if $1
# eg. otp_src_R13B (this is erlang's style) # eg. otp_src_R13B (this is erlang's style)

View File

@ -164,4 +164,9 @@ class VersionTests < Test::Unit::TestCase
check 'https://downloads.sourceforge.net/project/machomebrew/Bottles/qt-4.7.3-bottle.tar.gz', check 'https://downloads.sourceforge.net/project/machomebrew/Bottles/qt-4.7.3-bottle.tar.gz',
'4.7.3' '4.7.3'
end 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 end