diff options
| author | Mike McQuaid | 2017-07-30 21:44:43 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2017-07-30 21:44:43 +0100 |
| commit | 044f4d947bd7f75efcab427716769697c0fa0b10 (patch) | |
| tree | 2cc1d858ab6f85584393a2eca768404df60939c6 /Library/Homebrew/cmd/upgrade.rb | |
| parent | 9d55446cd065801b16af11fc492895eb178262d2 (diff) | |
| download | brew-044f4d947bd7f75efcab427716769697c0fa0b10.tar.bz2 | |
Tweak preserve link status on reinstall/upgrade.
Treat a `brew install` command as normal i.e. link by default unless
keg-only and only specify whether a keg should be linked when upgrading
or reinstalling. Also, adjust the naming accordingly so it's more
obvious that this is the case.
Diffstat (limited to 'Library/Homebrew/cmd/upgrade.rb')
| -rw-r--r-- | Library/Homebrew/cmd/upgrade.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index cb6e6a5ab..1cdb497cf 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -101,6 +101,12 @@ module Homebrew end def upgrade_formula(f) + if f.opt_prefix.directory? + keg = Keg.new(f.opt_prefix.resolved_path) + keg_had_linked_opt = true + keg_was_linked = keg.linked? + end + formulae_maybe_with_kegs = [f] + f.old_installed_formulae outdated_kegs = formulae_maybe_with_kegs .map(&:linked_keg) @@ -118,6 +124,7 @@ module Homebrew fi.options &= f.options fi.build_bottle = ARGV.build_bottle? || (!f.bottled? && f.build.build_bottle?) fi.installed_on_request = !ARGV.named.empty? + fi.link_keg = keg_was_linked if keg_had_linked_opt if tab fi.installed_as_dependency = tab.installed_as_dependency fi.installed_on_request ||= tab.installed_on_request |
