diff options
| author | Mike McQuaid | 2012-08-25 10:20:48 -0700 | 
|---|---|---|
| committer | Mike McQuaid | 2012-08-25 10:21:48 -0700 | 
| commit | 580180bffeb2f1d7c8e0f397710ea9785797027a (patch) | |
| tree | c1648a924fcd115e84a4d00e72d3024ae59032cd | |
| parent | c7770efdc759da456d89502aa3c0414260766a99 (diff) | |
| download | homebrew-580180bffeb2f1d7c8e0f397710ea9785797027a.tar.bz2 | |
erlang: fix version detection and bottles.
| -rw-r--r-- | Library/Formula/erlang.rb | 1 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_versions.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/version.rb | 10 | 
3 files changed, 13 insertions, 6 deletions
diff --git a/Library/Formula/erlang.rb b/Library/Formula/erlang.rb index 0f0a8d9bd..4f3771ca4 100644 --- a/Library/Formula/erlang.rb +++ b/Library/Formula/erlang.rb @@ -24,7 +24,6 @@ class Erlang < Formula    homepage 'http://www.erlang.org'    # Download tarball from GitHub; it is served faster than the official tarball.    url 'https://github.com/erlang/otp/tarball/OTP_R15B01' -  version 'R15B01'    sha1 'efc06b5058605e25bfde41d614a2040f282c2601'    bottle do diff --git a/Library/Homebrew/test/test_versions.rb b/Library/Homebrew/test/test_versions.rb index 52e0cccd1..49f6b9a1d 100644 --- a/Library/Homebrew/test/test_versions.rb +++ b/Library/Homebrew/test/test_versions.rb @@ -93,6 +93,10 @@ class VersionParsingTests < Test::Unit::TestCase      assert_version_detected 'R13B', 'http://erlang.org/download/otp_src_R13B.tar.gz'    end +  def test_another_erlang_version_style +    assert_version_detected 'R15B01', 'https://github.com/erlang/otp/tarball/OTP_R15B01' +  end +    def test_p7zip_version_style      assert_version_detected '9.04',        'http://kent.dl.sourceforge.net/sourceforge/p7zip/p7zip_9.04_src_all.tar.bz2' @@ -203,6 +207,10 @@ class VersionParsingTests < Test::Unit::TestCase      assert_version_detected 'R15B', 'https://downloads.sf.net/project/machomebrew/Bottles/erlang-R15B.lion.bottle.tar.gz'    end +  def test_another_erlang_bottle_style +    assert_version_detected 'R15B01', 'https://downloads.sf.net/project/machomebrew/Bottles/erlang-R15B01.mountainlion.bottle.tar.gz' +  end +    def test_old_bottle_style      assert_version_detected '4.7.3', 'https://downloads.sf.net/project/machomebrew/Bottles/qt-4.7.3-bottle.tar.gz'    end diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb index 796538cfd..9e2fd32ae 100644 --- a/Library/Homebrew/version.rb +++ b/Library/Homebrew/version.rb @@ -127,6 +127,10 @@ class Version      m = %r[github.com/.+/(?:zip|tar)ball/v?((\d+\.)+\d+_(\d+))$].match(spec.to_s)      return m.captures.first unless m.nil? +    # e.g. https://github.com/erlang/otp/tarball/OTP_R15B01 (erlang style) +    m = /[-_](R\d+[AB]\d*)/.match(spec.to_s) +    return m.captures.first unless m.nil? +      # e.g. boost_1_39_0      m = /((\d+_)+\d+)$/.match(stem)      return m.captures.first.gsub('_', '.') unless m.nil? @@ -164,14 +168,10 @@ class Version      m = /_((\d+\.)+\d+[abc]?)[.]orig$/.match(stem)      return m.captures.first unless m.nil? -    # e.g. erlang-R14B03-bottle.tar.gz (old erlang bottle style) +    # e.g. http://www.openssl.org/source/openssl-0.9.8s.tar.gz      m = /-([^-]+)/.match(stem)      return m.captures.first unless m.nil? -    # e.g. opt_src_R13B (erlang) -    m = /otp_src_(.+)/.match(stem) -    return m.captures.first unless m.nil? -      # e.g. astyle_1.23_macosx.tar.gz      m = /_([^_]+)/.match(stem)      return m.captures.first unless m.nil?  | 
