Deprecate _fetch without timeout option.
This commit is contained in:
parent
5cca3c5fd7
commit
59f4a711cd
4
Library/Homebrew/compat/early.rb
Normal file
4
Library/Homebrew/compat/early.rb
Normal file
@ -0,0 +1,4 @@
|
||||
# typed: strict
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "early/download_strategy"
|
||||
@ -1,4 +1,4 @@
|
||||
# typed: strict
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "compat/download_strategy"
|
||||
require_relative "late/download_strategy"
|
||||
20
Library/Homebrew/compat/late/download_strategy.rb
Normal file
20
Library/Homebrew/compat/late/download_strategy.rb
Normal 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
|
||||
@ -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?
|
||||
|
||||
@ -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?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user