Skip to content

Commit

Permalink
Merge pull request #4430 from MikeMcQuaid/handle-build-dep-reqs
Browse files Browse the repository at this point in the history
formula_installer: correctly handle build dep reqs.
  • Loading branch information
MikeMcQuaid authored Jul 5, 2018
2 parents c432dbd + 139fef8 commit 9fff177
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Library/Homebrew/formula_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,12 @@ def runtime_requirements(formula)

def expand_requirements
unsatisfied_reqs = Hash.new { |h, k| h[k] = [] }
deps = []
req_deps = []
formulae = [formula]
formula_deps_map = Dependency.expand(formula)
.each_with_object({}) do |dep, hash|
hash[dep.name] = dep
end

while f = formulae.pop
runtime_requirements = runtime_requirements(f)
Expand All @@ -453,16 +457,18 @@ def expand_requirements
next
elsif !runtime_requirements.include?(req) && install_bottle_for_dependent
Requirement.prune
elsif (dep = formula_deps_map[dependent.name]) && dep.build?
Requirement.prune
else
unsatisfied_reqs[dependent] << req
end
end
end

# Merge the repeated dependencies, which may have different tags.
deps = Dependency.merge_repeats(deps)
req_deps = Dependency.merge_repeats(req_deps)

[unsatisfied_reqs, deps]
[unsatisfied_reqs, req_deps]
end

def expand_dependencies(deps)
Expand Down

0 comments on commit 9fff177

Please sign in to comment.