refactoring install.rb and reinstall.rb after removing Formula.installed

This commit is contained in:
thibhero 2025-06-17 21:12:47 -04:00
parent 27a040cc32
commit fe06e04e28
2 changed files with 34 additions and 68 deletions

View File

@ -336,7 +336,6 @@ module Homebrew
skip_link: args.skip_link?,
)
if args.ask?
dependants = Upgrade.dependants(
installed_formulae,
flags: args.flags_only,
@ -354,6 +353,7 @@ module Homebrew
dry_run: args.dry_run?,
)
if args.ask?
formulae_dependencies = Install.collect_dependencies(formulae_installer, dependants)
# Main block: if asking the user is enabled, show dependency and size information.
Install.ask_formulae(formulae_dependencies, args: args)
@ -363,24 +363,6 @@ module Homebrew
dry_run: args.dry_run?,
verbose: args.verbose?)
unless args.ask?
dependants = Upgrade.dependants(
installed_formulae,
flags: args.flags_only,
dry_run: args.dry_run?,
installed_on_request: !args.as_dependency?,
force_bottle: args.force_bottle?,
build_from_source_formulae: args.build_from_source_formulae,
interactive: args.interactive?,
keep_tmp: args.keep_tmp?,
debug_symbols: args.debug_symbols?,
force: args.force?,
debug: args.debug?,
quiet: args.quiet?,
verbose: args.verbose?,
)
end
if dependants.present?
Upgrade.upgrade_dependents(
dependants, installed_formulae,

View File

@ -152,7 +152,6 @@ module Homebrew
)
end
if args.ask?
dependants = Upgrade.dependants(
formulae,
flags: args.flags_only,
@ -170,10 +169,11 @@ module Homebrew
formulae_installer = formulae_kegs.map(&:formula_installer)
if args.ask?
formulae_dependencies = Install.collect_dependencies(formulae_installer, dependants)
# Main block: if asking the user is enabled, show dependency and size information.
Install.ask_formulae(formulae_dependencies, args: args)
end
formulae_kegs.each do |f|
@ -194,22 +194,6 @@ module Homebrew
Cleanup.install_formula_clean!(f.formula)
end
unless args.ask?
dependants = Upgrade.dependants(
formulae,
flags: args.flags_only,
force_bottle: args.force_bottle?,
build_from_source_formulae: args.build_from_source_formulae,
interactive: args.interactive?,
keep_tmp: args.keep_tmp?,
debug_symbols: args.debug_symbols?,
force: args.force?,
debug: args.debug?,
quiet: args.quiet?,
verbose: args.verbose?,
)
end
if dependants.present?
Upgrade.upgrade_dependents(
dependants, formulae,