Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formula_installer: fix :test requirement expansion. #7613

Merged
merged 1 commit into from
May 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 12 additions & 6 deletions Library/Homebrew/formula_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -457,12 +457,18 @@ def expand_requirements
Requirement.prune
elsif req.satisfied?
Requirement.prune
elsif include_test? && req.test?
next
elsif !runtime_requirements.include?(req) && install_bottle_for_dependent
Requirement.prune
elsif (dep = formula_deps_map[dependent.name]) && dep.build?
Requirement.prune
elsif req.test? || req.build?
keep = false
keep ||= runtime_requirements.include?(req)
keep ||= req.test? && include_test? && dependent == f
keep ||= req.build? && !install_bottle_for_dependent
keep ||= (dep = formula_deps_map[dependent.name]) && !dep.build?

if keep
unsatisfied_reqs[dependent] << req
else
Requirement.prune
end
else
unsatisfied_reqs[dependent] << req
end
Expand Down