From 4373aad1532a495402a7a3afb70c356b7aa399ba Mon Sep 17 00:00:00 2001 From: botantony Date: Wed, 7 May 2025 14:07:36 +0200 Subject: [PATCH 1/2] cask/dsl: set `no_autobump!` if `:extract_plist` livecheck strategy is used Signed-off-by: botantony --- Library/Homebrew/autobump_constants.rb | 1 + Library/Homebrew/cask/dsl.rb | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/Library/Homebrew/autobump_constants.rb b/Library/Homebrew/autobump_constants.rb index 15f6ed8ea5..d39f513dc4 100644 --- a/Library/Homebrew/autobump_constants.rb +++ b/Library/Homebrew/autobump_constants.rb @@ -5,4 +5,5 @@ NO_AUTOBUMP_REASONS_LIST = T.let({ incompatible_version_format: "incompatible version format", bumped_by_upstream: "bumped by upstream", + extract_plist: "livecheck uses `:extract_plist` strategy", }.freeze, T::Hash[Symbol, String]) diff --git a/Library/Homebrew/cask/dsl.rb b/Library/Homebrew/cask/dsl.rb index 5363e58237..d05d7a0058 100644 --- a/Library/Homebrew/cask/dsl.rb +++ b/Library/Homebrew/cask/dsl.rb @@ -161,6 +161,8 @@ module Cask @token = T.let(cask.token, String) @url = T.let(nil, T.nilable(URL)) @version = T.let(nil, T.nilable(DSL::Version)) + + set_no_autobump! end sig { returns(T::Boolean) } @@ -175,6 +177,12 @@ module Cask sig { returns(T::Boolean) } def livecheck_defined? = @livecheck_defined + def set_no_autobump! + return if @livecheck.strategy != :extract_plist + + no_autobump! because: :extract_plist + end + sig { returns(T::Boolean) } def on_system_blocks_exist? = @on_system_blocks_exist From 6cea5ef4f010fb726c99d56c95e9939205945733 Mon Sep 17 00:00:00 2001 From: botantony Date: Wed, 7 May 2025 16:02:35 +0200 Subject: [PATCH 2/2] cask/dsl: exclude from autobump if `version` is `:latest` Signed-off-by: botantony --- Library/Homebrew/autobump_constants.rb | 1 + Library/Homebrew/cask/dsl.rb | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Library/Homebrew/autobump_constants.rb b/Library/Homebrew/autobump_constants.rb index d39f513dc4..0803803fe6 100644 --- a/Library/Homebrew/autobump_constants.rb +++ b/Library/Homebrew/autobump_constants.rb @@ -6,4 +6,5 @@ NO_AUTOBUMP_REASONS_LIST = T.let({ incompatible_version_format: "incompatible version format", bumped_by_upstream: "bumped by upstream", extract_plist: "livecheck uses `:extract_plist` strategy", + latest_version: "`version` is set to `:latest`", }.freeze, T::Hash[Symbol, String]) diff --git a/Library/Homebrew/cask/dsl.rb b/Library/Homebrew/cask/dsl.rb index d05d7a0058..2387eabb30 100644 --- a/Library/Homebrew/cask/dsl.rb +++ b/Library/Homebrew/cask/dsl.rb @@ -177,6 +177,7 @@ module Cask sig { returns(T::Boolean) } def livecheck_defined? = @livecheck_defined + sig { void } def set_no_autobump! return if @livecheck.strategy != :extract_plist @@ -359,6 +360,8 @@ module Cask raise CaskInvalidError.new(cask, "invalid 'version' value: #{arg.inspect}") end + no_autobump! because: :latest_version if arg == :latest + DSL::Version.new(arg) end end