formula_installer: reduce dependency expansion computations
This commit is contained in:
parent
344ab02f18
commit
96670cedb2
@ -517,10 +517,12 @@ class FormulaInstaller
|
||||
# Compute and collect the dependencies needed by the formula currently
|
||||
# being installed.
|
||||
def compute_dependencies
|
||||
@compute_dependencies ||= begin
|
||||
req_map, req_deps = expand_requirements
|
||||
check_requirements(req_map)
|
||||
expand_dependencies(req_deps + formula.deps)
|
||||
end
|
||||
end
|
||||
|
||||
def unbottled_dependencies(deps)
|
||||
deps.map(&:first).map(&:to_formula).reject do |dep_f|
|
||||
@ -1232,10 +1234,9 @@ class FormulaInstaller
|
||||
end
|
||||
|
||||
return if forbidden_licenses.blank?
|
||||
return if ignore_deps?
|
||||
|
||||
compute_dependencies.each do |dep, _|
|
||||
next if @ignore_deps
|
||||
|
||||
dep_f = dep.to_formula
|
||||
next unless SPDX.licenses_forbid_installation? dep_f.license, forbidden_licenses
|
||||
|
||||
@ -1244,7 +1245,8 @@ class FormulaInstaller
|
||||
#{SPDX.license_expression_to_string dep_f.license}.
|
||||
EOS
|
||||
end
|
||||
return if @only_deps
|
||||
|
||||
return if only_deps?
|
||||
|
||||
return unless SPDX.licenses_forbid_installation? formula.license, forbidden_licenses
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user