Merge pull request #13179 from samford/curl-download-try_partial-false
`#curl_download`: default `try_partial` to `false`
This commit is contained in:
commit
51329d9392
@ -375,6 +375,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
|
||||
|
||||
def initialize(url, name, version, **meta)
|
||||
super
|
||||
@try_partial = true
|
||||
@mirrors = meta.fetch(:mirrors, [])
|
||||
end
|
||||
|
||||
@ -523,7 +524,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
|
||||
end
|
||||
|
||||
def _curl_download(resolved_url, to, timeout)
|
||||
curl_download resolved_url, to: to, timeout: timeout
|
||||
curl_download resolved_url, to: to, try_partial: @try_partial, timeout: timeout
|
||||
end
|
||||
|
||||
# Curl options to be always passed to curl,
|
||||
@ -577,7 +578,7 @@ class HomebrewCurlDownloadStrategy < CurlDownloadStrategy
|
||||
def _curl_download(resolved_url, to, timeout)
|
||||
raise HomebrewCurlDownloadStrategyError, url unless Formula["curl"].any_version_installed?
|
||||
|
||||
curl_download resolved_url, to: to, timeout: timeout, use_homebrew_curl: true
|
||||
curl_download resolved_url, to: to, try_partial: @try_partial, timeout: timeout, use_homebrew_curl: true
|
||||
end
|
||||
end
|
||||
|
||||
@ -656,7 +657,7 @@ class CurlPostDownloadStrategy < CurlDownloadStrategy
|
||||
query.nil? ? [url, "-X", "POST"] : [url, "-d", query]
|
||||
end
|
||||
|
||||
curl_download(*args, to: temporary_path, timeout: timeout)
|
||||
curl_download(*args, to: temporary_path, try_partial: @try_partial, timeout: timeout)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -161,7 +161,7 @@ module Utils
|
||||
result
|
||||
end
|
||||
|
||||
def curl_download(*args, to: nil, try_partial: true, **options)
|
||||
def curl_download(*args, to: nil, try_partial: false, **options)
|
||||
destination = Pathname(to)
|
||||
destination.dirname.mkpath
|
||||
|
||||
|
||||
@ -34,8 +34,8 @@ module SPDX
|
||||
|
||||
def download_latest_license_data!(to: DATA_PATH)
|
||||
data_url = "https://raw.githubusercontent.com/spdx/license-list-data/#{latest_tag}/json/"
|
||||
curl_download("#{data_url}licenses.json", to: to/"spdx_licenses.json", try_partial: false)
|
||||
curl_download("#{data_url}exceptions.json", to: to/"spdx_exceptions.json", try_partial: false)
|
||||
curl_download("#{data_url}licenses.json", to: to/"spdx_licenses.json")
|
||||
curl_download("#{data_url}exceptions.json", to: to/"spdx_exceptions.json")
|
||||
end
|
||||
|
||||
def parse_license_expression(license_expression)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user