aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorShaun Jackman2017-06-09 11:44:25 -0700
committerShaun Jackman2017-06-13 13:12:23 -0700
commit7dca9a13ee59b55e4074770090127ebd6787267e (patch)
treee65c8b94579771f0ba324f3a83758284eed2a4d0 /Library
parent054ed10cb1ea2d64c39ba2a3208c14a33d31274d (diff)
downloadbrew-7dca9a13ee59b55e4074770090127ebd6787267e.tar.bz2
BottleLoader: Fix installing a bottle from an URL
The name of the formula is not extracted correctly when the URL includes a hyphen.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formulary.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb
index a0ccb9ba0..195d15cec 100644
--- a/Library/Homebrew/formulary.rb
+++ b/Library/Homebrew/formulary.rb
@@ -108,7 +108,8 @@ module Formulary
case bottle_name
when %r{(https?|ftp|file)://}
# The name of the formula is found between the last slash and the last hyphen.
- resource = Resource.new bottle_name[%r{([^/]+)-}, 1] { url bottle_name }
+ formula_name = File.basename(bottle_name)[/(.+)-/, 1]
+ resource = Resource.new(formula_name) { url bottle_name }
downloader = CurlBottleDownloadStrategy.new resource.name, resource
@bottle_filename = downloader.cached_location
cached = @bottle_filename.exist?