Merge pull request #3999 from MikeMcQuaid/leaves-handle-missing-formulae

cmd/leaves: handle missing formulae.
This commit is contained in:
Mike McQuaid 2018-03-29 14:12:56 +01:00 committed by GitHub
commit cd30820def
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,13 @@ module Homebrew
installed = Formula.installed.sort installed = Formula.installed.sort
deps_of_installed = installed.flat_map do |f| deps_of_installed = installed.flat_map do |f|
f.runtime_dependencies.map(&:to_formula).map(&:full_name) f.runtime_dependencies.map do |dep|
begin
dep.to_formula.full_name
rescue FormulaUnavailableError
dep.name
end
end
end end
leaves = installed.map(&:full_name) - deps_of_installed leaves = installed.map(&:full_name) - deps_of_installed