diff --git a/Library/Homebrew/dev-cmd/livecheck.rb b/Library/Homebrew/dev-cmd/livecheck.rb index 2b62b037a5..04cb4d0f5a 100644 --- a/Library/Homebrew/dev-cmd/livecheck.rb +++ b/Library/Homebrew/dev-cmd/livecheck.rb @@ -93,24 +93,19 @@ module Homebrew end if skip_autobump? - autobump_files = {} - - formulae_and_casks_to_check.each do |formula_or_cask| - tap = formula_or_cask.tap - next if tap.nil? - - autobump_files[tap] ||= begin - autobump_path = tap.path/".github/autobump.txt" - autobump_path.exist? ? File.read(autobump_path).lines.map(&:strip) : [] - end - end + autobump_lists = {} formulae_and_casks_to_check = formulae_and_casks_to_check.reject do |formula_or_cask| tap = formula_or_cask.tap next false if tap.nil? + autobump_lists[tap] ||= begin + autobump_path = tap.path/".github/autobump.txt" + autobump_path.exist? ? autobump_path.readlines.map(&:strip) : [] + end + name = formula_or_cask.respond_to?(:token) ? formula_or_cask.token : formula_or_cask.name - if autobump_files[tap].include?(name) + if autobump_lists[tap].include?(name) odebug "Skipping #{name} as it is autobumped in #{tap}." true end diff --git a/Library/Homebrew/env_config.rb b/Library/Homebrew/env_config.rb index f781de80ce..1ddc3823ae 100644 --- a/Library/Homebrew/env_config.rb +++ b/Library/Homebrew/env_config.rb @@ -296,6 +296,10 @@ module Homebrew default_text: 'The "Beer Mug" emoji.', default: "🍺", }, + HOMEBREW_LIVECHECK_AUTOBUMP: { + description: "If set, `brew livecheck` will include data for packages that are autobumped by BrewTestBot.", + boolean: true, + }, HOMEBREW_LIVECHECK_WATCHLIST: { description: "Consult this file for the list of formulae to check by default when no formula argument " \ "is passed to `brew livecheck`.", @@ -303,10 +307,6 @@ module Homebrew "or `$HOME/.homebrew/livecheck_watchlist.txt` otherwise.", default: "#{ENV.fetch("HOMEBREW_USER_CONFIG_HOME")}/livecheck_watchlist.txt", }, - HOMEBREW_LIVECHECK_AUTOBUMP: { - description: "If set, `brew livecheck` will include data for packages that are autobumped by BrewTestBot.", - boolean: true, - }, HOMEBREW_LOCK_CONTEXT: { description: "If set, Homebrew will add this output as additional context for locking errors. " \ "This is useful when running `brew` in the background.",