From d376b46a7ddfae55777675c4b037e7e6d23c0d9f Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Wed, 8 Nov 2023 09:13:09 -0500 Subject: [PATCH] Skip items strategy blocks in #livecheck_min_os The `#livecheck_min_os` cask audit method should be skipped when a `Sparkle` `livecheck` block contains a `strategy` block that uses the `items` argument (instead of `item`). These `strategy` blocks contain arbitrary logic that ignores/overrides the strategy's sorting, so we can't identify which item would be first/newest. --- Library/Homebrew/cask/audit.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Library/Homebrew/cask/audit.rb b/Library/Homebrew/cask/audit.rb index 74f255020d..51b07e781b 100644 --- a/Library/Homebrew/cask/audit.rb +++ b/Library/Homebrew/cask/audit.rb @@ -597,6 +597,12 @@ module Cask return unless cask.livecheckable? return if cask.livecheck.strategy != :sparkle + # `Sparkle` strategy blocks that use the `items` argument (instead of + # `item`) contain arbitrary logic that ignores/overrides the strategy's + # sorting, so we can't identify which item would be first/newest here. + return if cask.livecheck.strategy_block.present? && + cask.livecheck.strategy_block.parameters[0] == [:opt, :items] + out, _, status = curl_output("--fail", "--silent", "--location", cask.livecheck.url) return unless status.success?