Only check @specs for :using if @specs exists. Fixes Homebrew/homebrew#1127.

This commit is contained in:
Adam Vandenberg 2010-04-06 13:13:50 -07:00
parent 663ea030fc
commit d9fe4f00a4

View File

@ -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