Merge pull request #12004 from FnControlOption/upgrade-fix

install, upgrade: recompute dependencies before installation
This commit is contained in:
Mike McQuaid 2021-09-08 17:40:15 +01:00 committed by GitHub
commit 40a7a01196
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -358,7 +358,7 @@ class FormulaInstaller
raise UnbottledError, [formula] if !pour_bottle? && !formula.bottle_unneeded? && !DevelopmentTools.installed?
unless ignore_deps?
deps = compute_dependencies
deps = compute_dependencies(use_cache: false)
if ((pour_bottle? && !DevelopmentTools.installed?) || build_bottle?) &&
(unbottled = unbottled_dependencies(deps)).presence
# Check that each dependency in deps has a bottle available, terminating
@ -475,7 +475,8 @@ class FormulaInstaller
# Compute and collect the dependencies needed by the formula currently
# being installed.
def compute_dependencies
def compute_dependencies(use_cache: true)
@compute_dependencies = nil unless use_cache
@compute_dependencies ||= begin
check_requirements(expand_requirements)
expand_dependencies