Merge pull request #19910 from botantony/no_autobump_extract_plist

cask/dsl: set `no_autobump!` automatically in some cases
This commit is contained in:
Mike McQuaid 2025-05-20 07:49:16 +00:00 committed by GitHub
commit 28eab5c9a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View File

@ -5,4 +5,6 @@
NO_AUTOBUMP_REASONS_LIST = T.let({ NO_AUTOBUMP_REASONS_LIST = T.let({
incompatible_version_format: "incompatible version format", incompatible_version_format: "incompatible version format",
bumped_by_upstream: "bumped by upstream", 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]) }.freeze, T::Hash[Symbol, String])

View File

@ -161,6 +161,8 @@ module Cask
@token = T.let(cask.token, String) @token = T.let(cask.token, String)
@url = T.let(nil, T.nilable(URL)) @url = T.let(nil, T.nilable(URL))
@version = T.let(nil, T.nilable(DSL::Version)) @version = T.let(nil, T.nilable(DSL::Version))
set_no_autobump!
end end
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
@ -175,6 +177,13 @@ module Cask
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def livecheck_defined? = @livecheck_defined def livecheck_defined? = @livecheck_defined
sig { void }
def set_no_autobump!
return if @livecheck.strategy != :extract_plist
no_autobump! because: :extract_plist
end
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def on_system_blocks_exist? = @on_system_blocks_exist def on_system_blocks_exist? = @on_system_blocks_exist
@ -351,6 +360,8 @@ module Cask
raise CaskInvalidError.new(cask, "invalid 'version' value: #{arg.inspect}") raise CaskInvalidError.new(cask, "invalid 'version' value: #{arg.inspect}")
end end
no_autobump! because: :latest_version if arg == :latest
DSL::Version.new(arg) DSL::Version.new(arg)
end end
end end