Skip to content
Snippets Groups Projects
Commit 4790d4cb authored by Mike McQuaid's avatar Mike McQuaid
Browse files

formula_installer: default_formula using build.

Use the build options instead of whether the requirement is optional to
work out if it is needed. This handles the case of an optional
requirement becoming needed because it's a dependency for another
formula.

Closes Homebrew/homebrew#31476.
parent 045a02aa
No related branches found
No related tags found
No related merge requests found
......@@ -239,9 +239,9 @@ class FormulaInstaller
raise UnsatisfiedRequirements.new(f, fatals) unless fatals.empty?
end
def install_requirement_default_formula?(req)
def install_requirement_default_formula?(req, build)
return false unless req.default_formula?
return false if req.optional?
return false if build.without?(req)
return true unless req.satisfied?
pour_bottle? || build_bottle?
end
......@@ -262,7 +262,7 @@ class FormulaInstaller
Requirement.prune
elsif req.build? && dependent != f && install_bottle_for_dep?(dependent, build)
Requirement.prune
elsif install_requirement_default_formula?(req)
elsif install_requirement_default_formula?(req, build)
dep = req.to_dependency
deps.unshift(dep)
formulae.unshift(dep.to_formula)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment