diff options
| author | Zhiming Wang | 2016-09-24 05:53:17 -0400 |
|---|---|---|
| committer | GitHub | 2016-09-24 05:53:17 -0400 |
| commit | 687f0fcf721c8e36f32570ed72d0988a6eaf986f (patch) | |
| tree | 10b70cfbb333a1ce936251763d6c9a3cb85594ec | |
| parent | 12aad5c65fee39c5f044e39ca1efcbed58aebd39 (diff) | |
| parent | 19dcb2cf41ecadc4090390de82b8bb4e0e7e5aac (diff) | |
| download | brew-687f0fcf721c8e36f32570ed72d0988a6eaf986f.tar.bz2 | |
Merge pull request #1102 from zmwangx/alpha-rc-detection
version: improve alpha and rc detection (elasticsearch)
| -rw-r--r-- | Library/Homebrew/test/test_versions.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/version.rb | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/Library/Homebrew/test/test_versions.rb b/Library/Homebrew/test/test_versions.rb index 2a1a33a59..307bf6ead 100644 --- a/Library/Homebrew/test/test_versions.rb +++ b/Library/Homebrew/test/test_versions.rb @@ -203,6 +203,10 @@ class VersionParsingTests < Homebrew::TestCase assert_version_detected "0.7.1", "https://codeload.github.com/gsamokovarov/jump/tar.gz/v0.7.1" end + def test_elasticsearch_alpha_style + assert_version_detected "5.0.0-alpha5", "https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/5.0.0-alpha5/elasticsearch-5.0.0-alpha5.tar.gz" + end + def test_gloox_beta_style assert_version_detected "1.0-beta7", "http://camaya.net/download/gloox-1.0-beta7.tar.bz2" end diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb index 60eb6b571..e2085a8a6 100644 --- a/Library/Homebrew/version.rb +++ b/Library/Homebrew/version.rb @@ -340,8 +340,8 @@ class Version m = /-((?:\d+\.)*\d+(?:[abc]|rc|RC)\d*)$/.match(stem) return m.captures.first unless m.nil? - # e.g. foobar-4.5.0-beta1, or foobar-4.50-beta - m = /-((?:\d+\.)*\d+-beta\d*)$/.match(stem) + # e.g. foobar-4.5.0-alpha5, foobar-4.5.0-beta1, or foobar-4.50-beta + m = /-((?:\d+\.)*\d+-(?:alpha|beta|rc)\d*)$/.match(stem) return m.captures.first unless m.nil? # e.g. http://ftpmirror.gnu.org/libidn/libidn-1.29-win64.zip |
