More efficient autobump file reads - and support Casks
This commit is contained in:
parent
b54b9dad2a
commit
4b94bbb4d4
@ -90,16 +90,17 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Skip formulae that are autobumped by BrewTestBot.
|
# Skip packages that are autobumped by BrewTestBot, if there are any.
|
||||||
formulae_and_casks_to_check = formulae_and_casks_to_check.reject do |formula_or_cask|
|
if autobump_core_path.exist? && autobump_cask_path.exist?
|
||||||
next false if formula_or_cask.respond_to?(:token) # Only formulae are autobumped.
|
autobump_core = File.read(autobump_core_path).lines.map(&:strip)
|
||||||
|
autobump_cask = File.read(autobump_cask_path).lines.map(&:strip)
|
||||||
|
|
||||||
autobump_file = formula_or_cask.tap.path/".github/autobump.txt"
|
formulae_and_casks_to_check = formulae_and_casks_to_check.reject do |formula_or_cask|
|
||||||
next false unless File.exist?(autobump_file)
|
name = formula_or_cask.respond_to?(:token) ? formula_or_cask.token : formula_or_cask.name
|
||||||
|
if (autobump_core + autobump_cask).include?(name)
|
||||||
if File.read(autobump_file).include?(formula_or_cask.name)
|
odebug "Skipping #{name} as it is autobumped."
|
||||||
odebug "Skipping #{formula_or_cask.name} as it is autobumped."
|
true
|
||||||
true
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -130,6 +131,16 @@ module Homebrew
|
|||||||
def watchlist_path
|
def watchlist_path
|
||||||
@watchlist_path ||= T.let(File.expand_path(Homebrew::EnvConfig.livecheck_watchlist), T.nilable(String))
|
@watchlist_path ||= T.let(File.expand_path(Homebrew::EnvConfig.livecheck_watchlist), T.nilable(String))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { returns(Pathname) }
|
||||||
|
def autobump_core_path
|
||||||
|
@autobump_core_path ||= T.let(Tap.fetch("homebrew/core").path/".github/autobump.txt", T.nilable(Pathname))
|
||||||
|
end
|
||||||
|
|
||||||
|
sig { returns(Pathname) }
|
||||||
|
def autobump_cask_path
|
||||||
|
@autobump_cask_path ||= T.let(Tap.fetch("homebrew/cask").path/".github/autobump.txt", T.nilable(Pathname))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user