Deprecate _fetch without timeout option.

This commit is contained in:
Markus Reiter 2021-04-03 05:17:08 +02:00
parent 5cca3c5fd7
commit 59f4a711cd
No known key found for this signature in database
GPG Key ID: 245293B51702655B
6 changed files with 29 additions and 2 deletions

View File

@ -0,0 +1,4 @@
# typed: strict
# frozen_string_literal: true
require_relative "early/download_strategy"

View File

@ -1,4 +1,4 @@
# typed: strict
# frozen_string_literal: true
require "compat/download_strategy"
require_relative "late/download_strategy"

View File

@ -0,0 +1,20 @@
# typed: false
# frozen_string_literal: true
class CurlDownloadStrategy
module Compat
def _fetch(*args, **options)
unless options.key?(:timeout)
odeprecated "#{self.class}#_fetch"
options[:timeout] = nil
end
super(*args, **options)
end
end
prepend Compat
end
class CurlPostDownloadStrategy
prepend Compat
end

View File

@ -75,7 +75,7 @@ HOMEBREW_BOTTLES_EXTNAME_REGEX = /\.([a-z0-9_]+)\.bottle\.(?:(\d+)\.)?tar\.gz$/.
require "utils/sorbet"
require "env_config"
require "compat" unless Homebrew::EnvConfig.no_compat?
require "compat/early" unless Homebrew::EnvConfig.no_compat?
require "os"
require "messages"
@ -154,3 +154,5 @@ require "tap_constants"
# Enables `patchelf.rb` write support.
HOMEBREW_PATCHELF_RB_WRITE = ENV["HOMEBREW_NO_PATCHELF_RB_WRITE"].blank?.freeze
require "compat/late" unless Homebrew::EnvConfig.no_compat?

View File

@ -220,6 +220,7 @@ class SystemCommand
loop do
readable_sources, = IO.select(sources_remaining, [], [], end_time&.remaining!)
raise Timeout::Error if readable_sources.nil?
readable_sources = T.must(readable_sources)
break if readable_sources.empty?