cmd/update-report: use api_auto_update_secs default.

Otherwise this can be printed incorrectly.

As reported in https://github.com/Homebrew/brew/pull/14592#issuecomment-1623578695
This commit is contained in:
Mike McQuaid 2023-07-06 13:58:24 +01:00
parent 6959029ebc
commit 28817dfe6c
No known key found for this signature in database
GPG Key ID: 3338A31AFDB1D829

View File

@ -373,7 +373,9 @@ module Homebrew
def install_from_api_message
return if Settings.read("installfromapimessage") == "true"
auto_update_secs_set = Homebrew::EnvConfig.api_auto_update_secs.to_i.positive?
api_auto_update_secs = Homebrew::EnvConfig.api_auto_update_secs.to_i
api_auto_update_secs_default = Homebrew::EnvConfig::ENVS.fetch(:HOMEBREW_API_AUTO_UPDATE_SECS).fetch(:default)
auto_update_secs_set = api_auto_update_secs.positive? && api_auto_update_secs != api_auto_update_secs_default
if !Homebrew::EnvConfig.no_auto_update? && !Homebrew::EnvConfig.no_install_from_api? && !auto_update_secs_set
return
end