Only check @specs for :using if @specs exists. Fixes Homebrew/homebrew#1127.
This commit is contained in:
parent
663ea030fc
commit
d9fe4f00a4
@ -134,21 +134,23 @@ class Formula
|
||||
|
||||
# reimplement if we don't autodetect the download strategy you require
|
||||
def download_strategy
|
||||
vcs = @specs.delete :using
|
||||
if vcs != nil
|
||||
# If a class is passed, assume it is a download strategy
|
||||
return vcs if vcs.kind_of? Class
|
||||
if @specs
|
||||
vcs = @specs.delete :using
|
||||
if vcs != nil
|
||||
# If a class is passed, assume it is a download strategy
|
||||
return vcs if vcs.kind_of? Class
|
||||
|
||||
case vcs
|
||||
when :bzr then return BazaarDownloadStrategy
|
||||
when :curl then return CurlDownloadStrategy
|
||||
when :cvs then return CVSDownloadStrategy
|
||||
when :git then return GitDownloadStrategy
|
||||
when :hg then return MercurialDownloadStrategy
|
||||
when :svn then return SubversionDownloadStrategy
|
||||
case vcs
|
||||
when :bzr then return BazaarDownloadStrategy
|
||||
when :curl then return CurlDownloadStrategy
|
||||
when :cvs then return CVSDownloadStrategy
|
||||
when :git then return GitDownloadStrategy
|
||||
when :hg then return MercurialDownloadStrategy
|
||||
when :svn then return SubversionDownloadStrategy
|
||||
end
|
||||
|
||||
raise "Unknown strategy #{vcs} was requested."
|
||||
end
|
||||
|
||||
raise "Unknown strategy #{vcs} was requested."
|
||||
end
|
||||
|
||||
detect_download_strategy url
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user