brew-upgrade: Respect --ignore-dependencies flag

Passing `--ignore-dependencies` to `brew upgrade` will now have the desired
effect.
This commit is contained in:
Charlie Sharpsteen 2012-06-25 09:20:18 -08:00
parent b9f4b682b5
commit f165e0cf5f

View File

@ -29,14 +29,16 @@ module Homebrew extend self
end end
end end
# Expand the outdated list to include outdated dependencies then sort and unless ARGV.include? '--ignore-dependencies'
# reduce such that dependencies are installed first and installation is not # Expand the outdated list to include outdated dependencies then sort and
# attempted twice. Sorting is implicit the way `recursive_deps` returns # reduce such that dependencies are installed first and installation is not
# root dependencies at the head of the list and `uniq` keeps the first # attempted twice. Sorting is implicit the way `recursive_deps` returns
# element it encounters and discards the rest. # root dependencies at the head of the list and `uniq` keeps the first
outdated.map!{ |f| f.recursive_deps.reject{ |d| d.installed?} << f } # element it encounters and discards the rest.
outdated.flatten! outdated.map!{ |f| f.recursive_deps.reject{ |d| d.installed?} << f }
outdated.uniq! outdated.flatten!
outdated.uniq!
end
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:"