From 28817dfe6c95f2b92794870548e7cd1619566753 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 6 Jul 2023 13:58:24 +0100 Subject: [PATCH] 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 --- Library/Homebrew/cmd/update-report.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index a8064d260f..80796a9911 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -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