aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Abel2017-10-03 23:29:33 -0500
committerKevin Abel2017-10-03 23:29:33 -0500
commit9d36096d68d5b362f223b993ac7662588450d942 (patch)
treefb78eda482bd513c40faa91375fa263a8f0f5a31
parent7ee86cfe770bc19bf65509abf948ce363de90c59 (diff)
downloadbrew-9d36096d68d5b362f223b993ac7662588450d942.tar.bz2
Add version detection support for php URL
Pulls a semver from anywhere in the URL (not just stem).
-rw-r--r--Library/Homebrew/version.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb
index b03a4bc33..3ac748037 100644
--- a/Library/Homebrew/version.rb
+++ b/Library/Homebrew/version.rb
@@ -456,6 +456,10 @@ class Version
# 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?
+
+ # e.g. https://secure.php.net/get/php-7.1.10.tar.bz2/from/this/mirror
+ m = /[-.vV]?((?:\d+\.)+\d+(?:[-_.]?(?i:alpha|beta|pre|rc)\.?\d{,2})?)/.match(spec_s)
+ return m.captures.first unless m.nil?
end
end