refactoring as we can get dependants before installing

This commit is contained in:
thibhero 2025-06-17 19:21:17 -04:00
parent 8c203df671
commit 971a8b40e6

View File

@ -236,50 +236,32 @@ module Homebrew
verbose: args.verbose?, verbose: args.verbose?,
) )
if args.ask? dependants = Upgrade.dependants(
dependants = Upgrade.dependants( formulae_to_install,
formulae_to_install, flags: args.flags_only,
flags: args.flags_only, dry_run: args.dry_run?,
dry_run: args.dry_run?, ask: args.ask?,
ask: args.ask?, force_bottle: args.force_bottle?,
force_bottle: args.force_bottle?, build_from_source_formulae: args.build_from_source_formulae,
build_from_source_formulae: args.build_from_source_formulae, interactive: args.interactive?,
interactive: args.interactive?, keep_tmp: args.keep_tmp?,
keep_tmp: args.keep_tmp?, debug_symbols: args.debug_symbols?,
debug_symbols: args.debug_symbols?, force: args.force?,
force: args.force?, debug: args.debug?,
debug: args.debug?, quiet: args.quiet?,
quiet: args.quiet?, verbose: args.verbose?,
verbose: args.verbose?, )
)
if args.ask?
formulae_dependencies = Install.collect_dependencies(formulae_installer, dependants) formulae_dependencies = Install.collect_dependencies(formulae_installer, dependants)
# Main block: if asking the user is enabled, show dependency and size information. # Main block: if asking the user is enabled, show dependency and size information.
Install.ask_formulae(formulae_dependencies, args: args) Install.ask_formulae(formulae_dependencies, args: args)
end end
Upgrade.upgrade_formulae(formulae_installer, Upgrade.upgrade_formulae(formulae_installer,
dry_run: args.dry_run?, dry_run: args.dry_run?,
verbose: args.verbose?) verbose: args.verbose?)
unless args.ask?
dependants = Upgrade.dependants(
formulae_to_install,
flags: args.flags_only,
dry_run: args.dry_run?,
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? if dependants.present?
Upgrade.upgrade_dependents( Upgrade.upgrade_dependents(
dependants, formulae_to_install, dependants, formulae_to_install,