mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
tap: get autobump list from formula/cask API
Signed-off-by: botantony <antonsm21@gmail.com>
This commit is contained in:
parent
9ff2abbcdf
commit
ad66e0c418
@ -373,6 +373,7 @@ module Cask
|
||||
"version" => version,
|
||||
"autobump" => autobump?,
|
||||
"no_autobump_message" => no_autobump_message,
|
||||
"skip_livecheck" => livecheck.skip?,
|
||||
"installed" => installed_version,
|
||||
"installed_time" => install_time&.to_i,
|
||||
"bundle_version" => bundle_long_version,
|
||||
|
@ -100,10 +100,7 @@ module Homebrew
|
||||
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
|
||||
autobump_lists[tap] ||= tap.autobump
|
||||
|
||||
name = formula_or_cask.respond_to?(:token) ? formula_or_cask.token : formula_or_cask.name
|
||||
next unless autobump_lists[tap].include?(name)
|
||||
|
@ -2500,6 +2500,7 @@ class Formula
|
||||
"version_scheme" => version_scheme,
|
||||
"autobump" => autobump?,
|
||||
"no_autobump_message" => no_autobump_message,
|
||||
"skip_livecheck" => livecheck.skip?,
|
||||
"bottle" => {},
|
||||
"pour_bottle_only_if" => self.class.pour_bottle_only_if&.to_s,
|
||||
"keg_only" => keg_only?,
|
||||
|
@ -20,8 +20,6 @@ class Tap
|
||||
private_constant :HOMEBREW_TAP_FORMULA_RENAMES_FILE
|
||||
HOMEBREW_TAP_MIGRATIONS_FILE = "tap_migrations.json"
|
||||
private_constant :HOMEBREW_TAP_MIGRATIONS_FILE
|
||||
HOMEBREW_TAP_AUTOBUMP_FILE = ".github/autobump.txt"
|
||||
private_constant :HOMEBREW_TAP_AUTOBUMP_FILE
|
||||
HOMEBREW_TAP_PYPI_FORMULA_MAPPINGS_FILE = "pypi_formula_mappings.json"
|
||||
private_constant :HOMEBREW_TAP_PYPI_FORMULA_MAPPINGS_FILE
|
||||
HOMEBREW_TAP_SYNCED_VERSIONS_FORMULAE_FILE = "synced_versions_formulae.json"
|
||||
@ -985,10 +983,19 @@ class Tap
|
||||
# Array with autobump names
|
||||
sig { returns(T::Array[String]) }
|
||||
def autobump
|
||||
@autobump ||= if (autobump_file = path/HOMEBREW_TAP_AUTOBUMP_FILE).file?
|
||||
autobump_file.readlines(chomp: true)
|
||||
unless official?
|
||||
@autobump ||= []
|
||||
return @autobump
|
||||
end
|
||||
|
||||
@autobump ||= if core_cask_tap?
|
||||
Homebrew::API::Cask.all_casks.select do |_, cask|
|
||||
cask["autobump"] == true && !cask["skip_livecheck"]
|
||||
end.keys
|
||||
else
|
||||
[]
|
||||
Homebrew::API::Formula.all_formulae.select do |_, formula|
|
||||
formula["autobump"] == true && !formula["skip_livecheck"]
|
||||
end.keys
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -54,7 +54,6 @@ module Homebrew
|
||||
check_formula_list_directory "audit_exceptions", @tap_audit_exceptions
|
||||
check_formula_list_directory "style_exceptions", @tap_style_exceptions
|
||||
check_formula_list "pypi_formula_mappings", @tap_pypi_formula_mappings
|
||||
check_formula_list ".github/autobump.txt", @tap_autobump
|
||||
check_formula_list "formula_renames", @formula_renames.values
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user