resolving conversations from pull request

This commit is contained in:
thibhero 2025-03-07 11:32:34 -05:00
parent 6d3ca98207
commit d7723fa6ed
2 changed files with 14 additions and 17 deletions

View File

@ -49,7 +49,8 @@ module Homebrew
boolean: true, boolean: true,
}, },
HOMEBREW_ASK: { HOMEBREW_ASK: {
description: "If set, pass `--ask`to all formula install commands.", description: "If set, pass `--ask`to all formulae `brew install`, `brew upgrade` and `brew reinstall` " \
"commands.",
boolean: true, boolean: true,
}, },
HOMEBREW_AUTO_UPDATE_SECS: { HOMEBREW_AUTO_UPDATE_SECS: {

View File

@ -327,7 +327,7 @@ module Homebrew
puts formula_names.join(" ") puts formula_names.join(" ")
end end
# Main block: if asking the user is enabled, show dependency and size information. # If asking the user is enabled, show dependency and size information.
def ask(formulae, args:) def ask(formulae, args:)
ohai "Looking for bottles..." ohai "Looking for bottles..."
@ -410,18 +410,16 @@ module Homebrew
formula_list = [formula] formula_list = [formula]
deps = args.build_from_source? ? formula.deps.build : formula.deps.required deps = args.build_from_source? ? formula.deps.build : formula.deps.required
# If there are dependencies, try to gather outdated, bottled ones.
if deps.any? outdated_dependents = deps.map(&:to_formula).reject(&:pinned?).select do |dep|
outdated_dependents = deps.map(&:to_formula).reject(&:pinned?).select do |dep| dep.installed_kegs.empty? || (dep.bottled? && dep.outdated?)
dep.installed_kegs.empty? || (dep.bottled? && dep.outdated?)
end
deps.map(&:to_formula).each do |f|
outdated_dependents.concat(f.recursive_dependencies.map(&:to_formula).reject(&:pinned?).select do |dep|
dep.installed_kegs.empty? || (dep.bottled? && dep.outdated?)
end)
end
formula_list.concat(outdated_dependents)
end end
deps.map(&:to_formula).each do |f|
outdated_dependents.concat(f.recursive_dependencies.map(&:to_formula).reject(&:pinned?).select do |dep|
dep.installed_kegs.empty? || (dep.bottled? && dep.outdated?)
end)
end
formula_list.concat(outdated_dependents)
formula_list formula_list
end end
@ -430,7 +428,7 @@ module Homebrew
unless Homebrew::EnvConfig.no_installed_dependents_check? unless Homebrew::EnvConfig.no_installed_dependents_check?
sized_formulae.concat(Formula.installed.select do |installed_formula| sized_formulae.concat(Formula.installed.select do |installed_formula|
installed_formula.bottled? && installed_formula.outdated? && installed_formula.bottled? && installed_formula.outdated? &&
installed_formula.deps.required.any? { |dep| sized_formulae.include?(dep.to_formula) } installed_formula.deps.required.map(&:to_formula).intersect?(sized_formulae)
end) end)
end end
@ -443,9 +441,7 @@ module Homebrew
total_installed_size = 0 total_installed_size = 0
total_net_size = 0 total_net_size = 0
sized_formulae.each do |formula| sized_formulae.select(&:bottle).each do |formula|
next unless (bottle = formula.bottle)
# Fetch additional bottle metadata (if necessary). # Fetch additional bottle metadata (if necessary).
bottle.fetch_tab(quiet: !debug) bottle.fetch_tab(quiet: !debug)