mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
refactoring install.rb and reinstall.rb after removing Formula.installed
This commit is contained in:
parent
27a040cc32
commit
fe06e04e28
@ -336,7 +336,6 @@ module Homebrew
|
|||||||
skip_link: args.skip_link?,
|
skip_link: args.skip_link?,
|
||||||
)
|
)
|
||||||
|
|
||||||
if args.ask?
|
|
||||||
dependants = Upgrade.dependants(
|
dependants = Upgrade.dependants(
|
||||||
installed_formulae,
|
installed_formulae,
|
||||||
flags: args.flags_only,
|
flags: args.flags_only,
|
||||||
@ -354,6 +353,7 @@ module Homebrew
|
|||||||
dry_run: args.dry_run?,
|
dry_run: args.dry_run?,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
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)
|
||||||
@ -363,24 +363,6 @@ module Homebrew
|
|||||||
dry_run: args.dry_run?,
|
dry_run: args.dry_run?,
|
||||||
verbose: args.verbose?)
|
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?
|
if dependants.present?
|
||||||
Upgrade.upgrade_dependents(
|
Upgrade.upgrade_dependents(
|
||||||
dependants, installed_formulae,
|
dependants, installed_formulae,
|
||||||
|
@ -152,7 +152,6 @@ module Homebrew
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
if args.ask?
|
|
||||||
dependants = Upgrade.dependants(
|
dependants = Upgrade.dependants(
|
||||||
formulae,
|
formulae,
|
||||||
flags: args.flags_only,
|
flags: args.flags_only,
|
||||||
@ -170,10 +169,11 @@ module Homebrew
|
|||||||
|
|
||||||
formulae_installer = formulae_kegs.map(&:formula_installer)
|
formulae_installer = formulae_kegs.map(&:formula_installer)
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
formulae_kegs.each do |f|
|
formulae_kegs.each do |f|
|
||||||
@ -194,22 +194,6 @@ module Homebrew
|
|||||||
Cleanup.install_formula_clean!(f.formula)
|
Cleanup.install_formula_clean!(f.formula)
|
||||||
end
|
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?
|
if dependants.present?
|
||||||
Upgrade.upgrade_dependents(
|
Upgrade.upgrade_dependents(
|
||||||
dependants, formulae,
|
dependants, formulae,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user