CurlDownloadStrategy: remove pointless type introspection
This commit is contained in:
parent
3e9241312d
commit
8e2b8c1419
@ -73,23 +73,20 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
|
|||||||
unless @tarball_path.exist?
|
unless @tarball_path.exist?
|
||||||
begin
|
begin
|
||||||
_fetch
|
_fetch
|
||||||
rescue Exception => e
|
rescue ErrorDuringExecution
|
||||||
if e.kind_of? ErrorDuringExecution
|
raise CurlDownloadStrategyError, "Download failed: #{@url}"
|
||||||
raise CurlDownloadStrategyError, "Download failed: #{@url}"
|
|
||||||
else
|
|
||||||
raise
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
ignore_interrupts { @temporary_path.rename(@tarball_path) }
|
ignore_interrupts { @temporary_path.rename(@tarball_path) }
|
||||||
else
|
else
|
||||||
puts "Already downloaded: #{@tarball_path}"
|
puts "Already downloaded: #{@tarball_path}"
|
||||||
end
|
end
|
||||||
return @tarball_path # thus performs checksum verification
|
|
||||||
rescue CurlDownloadStrategyError
|
rescue CurlDownloadStrategyError
|
||||||
raise if @mirrors.empty?
|
raise if @mirrors.empty?
|
||||||
puts "Trying a mirror..."
|
puts "Trying a mirror..."
|
||||||
@url = @mirrors.shift
|
@url = @mirrors.shift
|
||||||
retry
|
retry
|
||||||
|
else
|
||||||
|
@tarball_path
|
||||||
end
|
end
|
||||||
|
|
||||||
def stage
|
def stage
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user