cask: ignore minimum macOS in on_os blocks for variations

This commit is contained in:
Eric Knibbe 2024-06-20 23:19:09 -04:00
parent 14d452fcde
commit 1ef1b0b556
No known key found for this signature in database
GPG Key ID: 179D9CDDDB814168
2 changed files with 6 additions and 2 deletions

View File

@ -440,7 +440,9 @@ module Cask
MacOSVersion::SYMBOLS.keys.product(OnSystem::ARCH_OPTIONS).each do |os, arch|
bottle_tag = ::Utils::Bottles::Tag.new(system: os, arch:)
next unless bottle_tag.valid_combination?
next if depends_on.macos && !depends_on.macos.allows?(bottle_tag.to_macos_version)
next if depends_on.macos &&
!@dsl.depends_on_set_in_block? &&
!depends_on.macos.allows?(bottle_tag.to_macos_version)
Homebrew::SimulateSystem.with(os:, arch:) do
refresh

View File

@ -95,6 +95,7 @@ module Cask
:livecheck,
:livecheckable?,
:on_system_blocks_exist?,
:depends_on_set_in_block?,
*ORDINARY_ARTIFACT_CLASSES.map(&:dsl_key),
*ACTIVATABLE_ARTIFACT_CLASSES.map(&:dsl_key),
*ARTIFACT_BLOCK_CLASSES.flat_map { |klass| [klass.dsl_key, klass.uninstall_dsl_key] },
@ -105,7 +106,7 @@ module Cask
attr_reader :cask, :token, :deprecation_date, :deprecation_reason, :disable_date, :disable_reason
attr_predicate :on_system_blocks_exist?, :deprecated?, :disabled?, :livecheckable?
attr_predicate :deprecated?, :disabled?, :livecheckable?, :on_system_blocks_exist?, :depends_on_set_in_block?
def initialize(cask)
@cask = cask
@ -353,6 +354,7 @@ module Cask
# @api public
def depends_on(**kwargs)
@depends_on ||= DSL::DependsOn.new
@depends_on_set_in_block = true if @called_in_on_system_block
return @depends_on if kwargs.empty?
begin