Skip to content

Commit

Permalink
Merge pull request Homebrew#7071 from SeekingMeaning/patch-1
Browse files Browse the repository at this point in the history
Fix detecting version from URL
  • Loading branch information
MikeMcQuaid committed Feb 23, 2020
2 parents 1cccba6 + 090a52a commit 2834a75
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Library/Homebrew/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def self._parse(spec)
# e.g. foobar-4.5.1-1
# e.g. unrtf_0.20.4-1
# e.g. ruby-1.9.1-p243
m = /[-_]((?:\d+\.)*\d\.\d+-(?:p|rc|RC)?\d+)(?:[-._](?:bin|dist|stable|src|sources))?$/.match(stem)
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
Expand All @@ -271,7 +271,7 @@ def self._parse(spec)
return m.captures.first unless m.nil?

# e.g. lame-398-1
m = /-((?:\d)+-\d+)/.match(stem)
m = /-(\d+-\d+)/.match(stem)
return m.captures.first unless m.nil?

# e.g. foobar-4.5.1
Expand Down Expand Up @@ -350,7 +350,7 @@ def self._parse(spec)
# e.g. https://wwwlehre.dhbw-stuttgart.de/~sschulz/WORK/E_DOWNLOAD/V_1.9/E.tgz
# e.g. https://github.com/JustArchi/ArchiSteamFarm/releases/download/2.3.2.0/ASF.zip
# e.g. https://people.gnome.org/~newren/eg/download/1.7.5.2/eg
m = %r{/([rvV]_?)?(\d\.\d+(\.\d+){,2})}.match(spec_s)
m = %r{/([rvV]_?)?(\d+\.\d+(\.\d+){,2})}.match(spec_s)
return m.captures.second unless m.nil?

# e.g. https://www.ijg.org/files/jpegsrc.v8d.tar.gz
Expand Down

0 comments on commit 2834a75

Please sign in to comment.