mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
making flow easier to understand
This commit is contained in:
parent
f674a3ac03
commit
2d39c7feb5
@ -69,11 +69,12 @@ module Homebrew
|
|||||||
)
|
)
|
||||||
fi.fetch_bottle_tab(quiet: !debug)
|
fi.fetch_bottle_tab(quiet: !debug)
|
||||||
|
|
||||||
if !dry_run && dependents
|
all_runtime_deps_installed = fi.bottle_tab_runtime_dependencies.presence&.all? do |dependency, hash|
|
||||||
fi.bottle_tab_runtime_dependencies.presence&.all? do |dependency, hash|
|
minimum_version = Version.new(hash["version"]) if hash["version"].present?
|
||||||
minimum_version = Version.new(hash["version"]) if hash["version"].present?
|
Dependency.new(dependency).installed?(minimum_version:, minimum_revision: hash["revision"])
|
||||||
Dependency.new(dependency).installed?(minimum_version:, minimum_revision: hash["revision"])
|
end
|
||||||
end
|
|
||||||
|
if !dry_run && dependents && all_runtime_deps_installed
|
||||||
# Don't need to install this bottle if all of the runtime
|
# Don't need to install this bottle if all of the runtime
|
||||||
# dependencies have the same or newer version already installed.
|
# dependencies have the same or newer version already installed.
|
||||||
next
|
next
|
||||||
@ -91,8 +92,8 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.upgrade_formulae(formula_installers, dry_run: false, verbose: false)
|
def self.upgrade_formulae(formula_installers, dry_run: false, verbose: false)
|
||||||
formula_installers.each do |fi|
|
unless dry_run
|
||||||
begin
|
formula_installers.each do |fi|
|
||||||
fi.prelude
|
fi.prelude
|
||||||
fi.fetch
|
fi.fetch
|
||||||
rescue CannotInstallFormulaError => e
|
rescue CannotInstallFormulaError => e
|
||||||
@ -100,7 +101,9 @@ module Homebrew
|
|||||||
rescue UnsatisfiedRequirements, DownloadError => e
|
rescue UnsatisfiedRequirements, DownloadError => e
|
||||||
ofail "#{fi.formula.full_name}: #{e}"
|
ofail "#{fi.formula.full_name}: #{e}"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
formula_installers.each do |fi|
|
||||||
upgrade_formula(fi, dry_run:, verbose:)
|
upgrade_formula(fi, dry_run:, verbose:)
|
||||||
Cleanup.install_formula_clean!(fi.formula, dry_run:)
|
Cleanup.install_formula_clean!(fi.formula, dry_run:)
|
||||||
end
|
end
|
||||||
@ -387,7 +390,9 @@ module Homebrew
|
|||||||
quiet:,
|
quiet:,
|
||||||
verbose:,
|
verbose:,
|
||||||
)
|
)
|
||||||
upgrade_formulae dependent_installers
|
puts "here", dependent_installers
|
||||||
|
puts "here", upgradeable
|
||||||
|
upgrade_formulae(dependent_installers, dry_run: dry_run, verbose: verbose)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Update installed formulae after upgrading
|
# Update installed formulae after upgrading
|
||||||
|
Loading…
x
Reference in New Issue
Block a user