Skip to content
Snippets Groups Projects
Commit 82051a56 authored by Jack Nagel's avatar Jack Nagel
Browse files

upgrade: offload dependency expansion to FormulaInstaller

Now that FormulaInstaller does dependency expansion the _right_ way,
avoid duplicating the logic in upgrade. Instead, offload it to the
installer, which will generate an exception in check_install_sanity that
we can safely ignore when formulae in the outdated list are upgraded as
part of the dependency tree of another outdated formula.
parent 18836d93
No related branches found
No related tags found
No related merge requests found
......@@ -32,17 +32,6 @@ module Homebrew extend self
exit 1 if outdated.empty?
end
# Expand the outdated list to include outdated dependencies then sort and
# reduce such that dependencies are installed first and installation is not
# attempted twice. Sorting is implicit the way `recursive_deps` returns
# root dependencies at the head of the list and `uniq` keeps the first
# element it encounters and discards the rest.
ARGV.filter_for_dependencies do
outdated.map!{ |f| f.recursive_deps.reject{ |d| d.installed? } << f }
outdated.flatten!
outdated.uniq!
end unless ARGV.ignore_deps?
if outdated.length > 1
oh1 "Upgrading #{outdated.length} outdated package#{outdated.length.plural_s}, with result:"
puts outdated.map{ |f| "#{f.name} #{f.version}" } * ", "
......
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