upgrade: filter ARGV when expanding deps
This serves the same purpose as similar code in FormulaInstaller, but we duplicate it because we do the dependency expansion in an ad-hoc fashion here. Fixes Homebrew/homebrew#11863. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
8a21bd52d5
commit
93f7a0fa85
@ -29,16 +29,16 @@ module Homebrew extend self
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
unless ARGV.ignore_deps?
|
# Expand the outdated list to include outdated dependencies then sort and
|
||||||
# Expand the outdated list to include outdated dependencies then sort and
|
# reduce such that dependencies are installed first and installation is not
|
||||||
# reduce such that dependencies are installed first and installation is not
|
# attempted twice. Sorting is implicit the way `recursive_deps` returns
|
||||||
# attempted twice. Sorting is implicit the way `recursive_deps` returns
|
# root dependencies at the head of the list and `uniq` keeps the first
|
||||||
# root dependencies at the head of the list and `uniq` keeps the first
|
# element it encounters and discards the rest.
|
||||||
# element it encounters and discards the rest.
|
ARGV.filter_for_dependencies do
|
||||||
outdated.map!{ |f| f.recursive_deps.reject{ |d| d.installed?} << f }
|
outdated.map!{ |f| f.recursive_deps.reject{ |d| d.installed? } << f }
|
||||||
outdated.flatten!
|
outdated.flatten!
|
||||||
outdated.uniq!
|
outdated.uniq!
|
||||||
end
|
end unless ARGV.ignore_deps?
|
||||||
|
|
||||||
if outdated.length > 1
|
if outdated.length > 1
|
||||||
oh1 "Upgrading #{outdated.length} outdated package#{outdated.length.plural_s}, with result:"
|
oh1 "Upgrading #{outdated.length} outdated package#{outdated.length.plural_s}, with result:"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user