diff options
| author | Charlie Sharpsteen | 2012-06-25 09:20:18 -0800 |
|---|---|---|
| committer | Charlie Sharpsteen | 2012-06-25 09:20:18 -0800 |
| commit | b9d370084e6f7891b336115802bf72b3bac69585 (patch) | |
| tree | 987d4bfa5985bd2d35c7ed4a32793443dcaf9e1f /Library | |
| parent | 6f646e6eca91cd859fd9c3e9a9bf2f10d94255c2 (diff) | |
| download | homebrew-b9d370084e6f7891b336115802bf72b3bac69585.tar.bz2 | |
brew-upgrade: Respect --ignore-dependencies flag
Passing `--ignore-dependencies` to `brew upgrade` will now have the desired
effect.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/upgrade.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 566649ed3..9a2448066 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -29,14 +29,16 @@ module Homebrew extend self end 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. - outdated.map!{ |f| f.recursive_deps.reject{ |d| d.installed?} << f } - outdated.flatten! - outdated.uniq! + unless ARGV.include? '--ignore-dependencies' + # 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 } + outdated.flatten! + outdated.uniq! + end if outdated.length > 1 oh1 "Upgrading #{outdated.length} outdated package#{outdated.length.plural_s}, with result:" |
