Skip to content

Commit

Permalink
Revert "Merge pull request Homebrew#10864 from reitermarkus/command-t…
Browse files Browse the repository at this point in the history
…imeout"

This reverts commit d55bdd3, reversing
changes made to 3c3bf1c.
  • Loading branch information
Rylan12 committed Mar 24, 2021
1 parent 0b8a9bc commit 57b2660
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 208 deletions.
9 changes: 4 additions & 5 deletions Library/Homebrew/cask/download.rb
Expand Up @@ -19,10 +19,9 @@ def initialize(cask, quarantine: nil)
@quarantine = quarantine
end

def fetch(quiet: nil, verify_download_integrity: true, timeout: nil)
def fetch(verify_download_integrity: true)
downloaded_path = begin
downloader.shutup! if quiet
downloader.fetch(timeout: timeout)
downloader.fetch
downloader.cached_location
rescue => e
error = CaskError.new("Download failed on Cask '#{cask}' with message: #{e}")
Expand All @@ -41,8 +40,8 @@ def downloader
end
end

def time_file_size(timeout: nil)
downloader.resolved_time_file_size(timeout: timeout)
def time_file_size
downloader.resolved_time_file_size
end

def clear_cache
Expand Down
17 changes: 7 additions & 10 deletions Library/Homebrew/cask/installer.rb
Expand Up @@ -62,15 +62,13 @@ def self.caveats(cask)
EOS
end

sig { params(quiet: T.nilable(T::Boolean), timeout: T.nilable(T.any(Integer, Float))).void }
def fetch(quiet: nil, timeout: nil)
def fetch
odebug "Cask::Installer#fetch"

verify_has_sha if require_sha? && !force?

download(quiet: quiet, timeout: timeout)

satisfy_dependencies

download
end

def stage
Expand Down Expand Up @@ -164,10 +162,9 @@ def downloader
@downloader ||= Download.new(@cask, quarantine: quarantine?)
end

sig { params(quiet: T.nilable(T::Boolean), timeout: T.nilable(T.any(Integer, Float))).returns(Pathname) }
def download(quiet: nil, timeout: nil)
@download ||= downloader.fetch(quiet: quiet, verify_download_integrity: @verify_download_integrity,
timeout: timeout)
sig { returns(Pathname) }
def download
@download ||= downloader.fetch(verify_download_integrity: @verify_download_integrity)
end

def verify_has_sha
Expand All @@ -182,7 +179,7 @@ def verify_has_sha

def primary_container
@primary_container ||= begin
downloaded_path = download(quiet: true)
downloaded_path = download
UnpackStrategy.detect(downloaded_path, type: @cask.container&.type, merge_xattrs: true)
end
end
Expand Down

0 comments on commit 57b2660

Please sign in to comment.