Merge pull request #19048 from Homebrew/force_api_auto_update

Add `HOMEBREW_FORCE_API_AUTO_UPDATE`
This commit is contained in:
Mike McQuaid 2025-01-07 16:40:12 +00:00 committed by GitHub
commit 6fb87ac5c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 1 deletions

View File

@ -60,7 +60,7 @@ module Homebrew
skip_download = target.exist? && skip_download = target.exist? &&
!target.empty? && !target.empty? &&
(!Homebrew.auto_update_command? || (!Homebrew.auto_update_command? ||
Homebrew::EnvConfig.no_auto_update? || (Homebrew::EnvConfig.no_auto_update? && !Homebrew::EnvConfig.force_api_auto_update?) ||
((Time.now - stale_seconds) < target.mtime)) ((Time.now - stale_seconds) < target.mtime))
skip_download ||= Homebrew.running_as_root_but_not_owned_by_root? skip_download ||= Homebrew.running_as_root_but_not_owned_by_root?

View File

@ -223,6 +223,10 @@ module Homebrew
"e.g. `brew install ./package.rb`.", "e.g. `brew install ./package.rb`.",
boolean: true, boolean: true,
}, },
HOMEBREW_FORCE_API_AUTO_UPDATE: {
description: "If set, update the Homebrew API formula or cask data even if `HOMEBREW_NO_AUTO_UPDATE` is set.",
boolean: true,
},
HOMEBREW_FORCE_BREWED_CA_CERTIFICATES: { HOMEBREW_FORCE_BREWED_CA_CERTIFICATES: {
description: "If set, always use a Homebrew-installed `ca-certificates` rather than the system version. " \ description: "If set, always use a Homebrew-installed `ca-certificates` rather than the system version. " \
"Automatically set if the system version is too old.", "Automatically set if the system version is too old.",

View File

@ -136,6 +136,9 @@ module Homebrew::EnvConfig
sig { returns(T.nilable(::String)) } sig { returns(T.nilable(::String)) }
def forbidden_taps; end def forbidden_taps; end
sig { returns(T::Boolean) }
def force_api_auto_update?; end
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def force_brewed_ca_certificates?; end def force_brewed_ca_certificates?; end