mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Fix version parsing on URLs with no extensions
This commit is contained in:
parent
30455d0fb5
commit
e865cee3d3
@ -361,4 +361,8 @@ class VersionParsingTests < Homebrew::TestCase
|
||||
assert_version_detected "1.0.2",
|
||||
"https://opam.ocaml.org/archives/easy-format.1.0.2+opam.tar.gz"
|
||||
end
|
||||
|
||||
def test_waf_version
|
||||
assert_version_detected "1.8.12", "https://waf.io/waf-1.8.12"
|
||||
end
|
||||
end
|
||||
|
@ -307,6 +307,10 @@ class Version
|
||||
m = /[-_]((?:\d+\.)*\d\.\d+-(?:p|rc|RC)?\d+)(?:[-._](?:bin|dist|stable|src|sources))?$/.match(stem)
|
||||
return m.captures.first unless m.nil?
|
||||
|
||||
# URL with no extension e.g. https://waf.io/waf-1.8.12
|
||||
m = /-((?:\d+\.)*\d+)$/.match(spec_s)
|
||||
return m.captures.first unless m.nil?
|
||||
|
||||
# e.g. lame-398-1
|
||||
m = /-((?:\d)+-\d)/.match(stem)
|
||||
return m.captures.first unless m.nil?
|
||||
|
Loading…
x
Reference in New Issue
Block a user