From 605c33c70ce5e57d6a7762afc0c52faf70d4a692 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Mon, 14 Dec 2020 06:06:49 +0100 Subject: [PATCH] Improve matching of Sparkle strategy. --- Library/Homebrew/livecheck/strategy.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/livecheck/strategy.rb b/Library/Homebrew/livecheck/strategy.rb index ede94b9708..d82b1e1560 100644 --- a/Library/Homebrew/livecheck/strategy.rb +++ b/Library/Homebrew/livecheck/strategy.rb @@ -63,10 +63,11 @@ module Homebrew # Only treat the `PageMatch` strategy as usable if a regex is # present in the `livecheck` block next unless regex_provided || block_provided - elsif strategy == Sparkle && (from_symbol(livecheck_strategy) != Sparkle || !url_provided) - # Skip the `Sparkle` strategy if a strategy is specified explicitly + elsif strategy == Sparkle + # Skip the `Sparkle` strategy if another strategy is specified explicitly # or if the URL is not specified explicitly. - next + next unless url_provided + next if livecheck_strategy && from_symbol(livecheck_strategy) != strategy elsif strategy.const_defined?(:PRIORITY) && !strategy::PRIORITY.positive? && from_symbol(livecheck_strategy) != strategy