diff options
| author | JCount | 2017-07-21 19:56:26 -0400 |
|---|---|---|
| committer | JCount | 2017-07-22 19:28:19 -0400 |
| commit | 1502e5b89780629bd5fc9d4d0e49a621c3be02fa (patch) | |
| tree | e928f441e2bc01473ba02efb9b67b9e13c9dfe26 /Library | |
| parent | 9747bc397a43f082aaaec24d4583ec465349eead (diff) | |
| download | brew-1502e5b89780629bd5fc9d4d0e49a621c3be02fa.tar.bz2 | |
version: improve devel spec version parsing
term this 'devel spec version style';
also improve dash version style parsing
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/version.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb index ddeaa6fee..b03a4bc33 100644 --- a/Library/Homebrew/version.rb +++ b/Library/Homebrew/version.rb @@ -406,6 +406,14 @@ class Version m = /[-_](\d+\.\d+(?:\.\d+)?(?:-\d+)?)[-_.](?:i[36]86|x86|x64(?:[-_](?:32|64))?)$/.match(stem) return m.captures.first unless m.nil? + # devel spec + # e.g. https://registry.npmjs.org/@angular/cli/-/cli-1.3.0-beta.1.tgz + # e.g. https://github.com/dlang/dmd/archive/v2.074.0-beta1.tar.gz + # e.g. https://github.com/dlang/dmd/archive/v2.074.0-rc1.tar.gz + # e.g. https://github.com/premake/premake-core/releases/download/v5.0.0-alpha10/premake-5.0.0-alpha10-src.zip + m = /[-.vV]?((?:\d+\.)+\d+[-_.]?(?i:alpha|beta|pre|rc)\.?\d{,2})/.match(stem) + return m.captures.first unless m.nil? + # e.g. foobar4.5.1 m = /((?:\d+\.)*\d+)$/.match(stem) return m.captures.first unless m.nil? @@ -414,6 +422,15 @@ class Version m = /-((?:\d+\.)+\d+[abc]?)[-._](?:bin|dist|stable|src|sources?)$/.match(stem) return m.captures.first unless m.nil? + # dash version style + # e.g. http://www.antlr.org/download/antlr-3.4-complete.jar + # e.g. https://cdn.nuxeo.com/nuxeo-9.2/nuxeo-server-9.2-tomcat.zip + # e.g. https://search.maven.org/remotecontent?filepath=com/facebook/presto/presto-cli/0.181/presto-cli-0.181-executable.jar + # e.g. https://search.maven.org/remotecontent?filepath=org/fusesource/fuse-extra/fusemq-apollo-mqtt/1.3/fusemq-apollo-mqtt-1.3-uber.jar + # e.g. https://search.maven.org/remotecontent?filepath=org/apache/orc/orc-tools/1.2.3/orc-tools-1.2.3-uber.jar + m = /-((?:\d+\.)+\d+)-/.match(stem) + return m.captures.first unless m.nil? + # e.g. dash_0.5.5.1.orig.tar.gz (Debian style) m = /_((?:\d+\.)+\d+[abc]?)[.]orig$/.match(stem) return m.captures.first unless m.nil? |
