From b12623f4eb9666003a8bb915a73ee6d621c81465 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Fri, 31 May 2019 20:37:57 +0200 Subject: [PATCH] =?UTF-8?q?Don't=20redownload=20=E2=80=9Clatest=E2=80=9D?= =?UTF-8?q?=20casks=20unnecessarily.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Library/Homebrew/cask/download.rb | 2 +- Library/Homebrew/download_strategy.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cask/download.rb b/Library/Homebrew/cask/download.rb index eb3a444bc4..4bd4e4426a 100644 --- a/Library/Homebrew/cask/download.rb +++ b/Library/Homebrew/cask/download.rb @@ -35,7 +35,7 @@ module Cask attr_accessor :downloaded_path def clear_cache - downloader.clear_cache if force || cask.version.latest? + downloader.clear_cache if force end def fetch diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 5afb8c13ed..924c17f117 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -296,6 +296,8 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy fresh = if cached_location.exist? && url_time url_time <= cached_location.mtime + elsif version.respond_to?(:latest?) + !version.latest? else true end