aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2013-01-27 22:34:53 +0000
committerMike McQuaid2013-01-30 21:29:19 -0800
commiteec8cc6a12b6676e8a8da3a7cced4547d8bd3c8b (patch)
treea43f079abb43351e7e4a97e671293284945d1548 /Library
parent0a3530ecd9201a96fa872f40c9c5392817dbbe79 (diff)
downloadbrew-eec8cc6a12b6676e8a8da3a7cced4547d8bd3c8b.tar.bz2
jpeg: support version format.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/test/test_versions.rb4
-rw-r--r--Library/Homebrew/version.rb4
2 files changed, 8 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_versions.rb b/Library/Homebrew/test/test_versions.rb
index 0458481b4..bdda4093b 100644
--- a/Library/Homebrew/test/test_versions.rb
+++ b/Library/Homebrew/test/test_versions.rb
@@ -243,6 +243,10 @@ class VersionParsingTests < Test::Unit::TestCase
assert_version_detected '1.2.0-rc2', 'http://www.apache.org/dyn/closer.cgi?path=/cassandra/1.2.0/apache-cassandra-1.2.0-rc2-bin.tar.gz'
end
+ def test_jpeg_style
+ assert_version_detected '8d', 'http://www.ijg.org/files/jpegsrc.v8d.tar.gz'
+ end
+
# def test_version_ghc_style
# assert_version_detected '7.0.4', 'http://www.haskell.org/ghc/dist/7.0.4/ghc-7.0.4-x86_64-apple-darwin.tar.bz2'
# assert_version_detected '7.0.4', 'http://www.haskell.org/ghc/dist/7.0.4/ghc-7.0.4-i386-apple-darwin.tar.bz2'
diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb
index 192463ed8..982c83bfe 100644
--- a/Library/Homebrew/version.rb
+++ b/Library/Homebrew/version.rb
@@ -183,6 +183,10 @@ class Version
# e.g. http://mirrors.jenkins-ci.org/war/1.486/jenkins.war
m = /\/(\d\.\d+)\//.match(spec.to_s)
return m.captures.first unless m.nil?
+
+ # e.g. http://www.ijg.org/files/jpegsrc.v8d.tar.gz
+ m = /\.v(\d+[a-z]?)/.match(stem)
+ return m.captures.first unless m.nil?
end
# DSL for defining comparators