Improve dash separated version detection.
* Also with test case. Closes Homebrew/homebrew#47584. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
This commit is contained in:
parent
c6f45a9e06
commit
e1dfafa54c
@ -365,4 +365,8 @@ class VersionParsingTests < Homebrew::TestCase
|
|||||||
def test_waf_version
|
def test_waf_version
|
||||||
assert_version_detected "1.8.12", "https://waf.io/waf-1.8.12"
|
assert_version_detected "1.8.12", "https://waf.io/waf-1.8.12"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_dash_separated_version
|
||||||
|
assert_version_detected "6-20151227", "ftp://gcc.gnu.org/pub/gcc/snapshots/6-20151227/gcc-6-20151227.tar.bz2"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -312,7 +312,7 @@ class Version
|
|||||||
return m.captures.first unless m.nil?
|
return m.captures.first unless m.nil?
|
||||||
|
|
||||||
# e.g. lame-398-1
|
# e.g. lame-398-1
|
||||||
m = /-((?:\d)+-\d)/.match(stem)
|
m = /-((?:\d)+-\d+)/.match(stem)
|
||||||
return m.captures.first unless m.nil?
|
return m.captures.first unless m.nil?
|
||||||
|
|
||||||
# e.g. foobar-4.5.1
|
# e.g. foobar-4.5.1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user