diff options
| author | Jack Nagel | 2012-08-18 18:13:01 -0500 | 
|---|---|---|
| committer | Jack Nagel | 2012-08-18 19:33:39 -0500 | 
| commit | 07d6ace2f2c231551acd22ef5224e8901aaa27c9 (patch) | |
| tree | 548c7cc006af3221c95a6829def8f2f9d026a749 /Library/Homebrew/cmd/upgrade.rb | |
| parent | ec5770b59011b71ad61fa9caba1632dda6af8cd0 (diff) | |
| download | homebrew-07d6ace2f2c231551acd22ef5224e8901aaa27c9.tar.bz2 | |
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 #11863.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew/cmd/upgrade.rb')
| -rw-r--r-- | Library/Homebrew/cmd/upgrade.rb | 16 | 
1 files changed, 8 insertions, 8 deletions
| diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 07558cbec..1afef1261 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -29,16 +29,16 @@ module Homebrew extend self        end      end -    unless ARGV.ignore_deps? -      # 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. -      outdated.map!{ |f| f.recursive_deps.reject{ |d| d.installed?} << f } +    # 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 +    end unless ARGV.ignore_deps?      if outdated.length > 1        oh1 "Upgrading #{outdated.length} outdated package#{outdated.length.plural_s}, with result:" | 
