aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2013-01-23 00:26:31 -0600
committerJack Nagel2013-01-26 12:14:51 -0600
commit5ac4e4f0714ffb364ac528d1a9b6697ae1693bf6 (patch)
treeacf40980afa448ac1fd75f37004b34392d8d2581
parent8d03c760c2429eaa25a268d267a65c8076c5e104 (diff)
downloadbrew-5ac4e4f0714ffb364ac528d1a9b6697ae1693bf6.tar.bz2
upgrade: use standard Tab accessor
Yes, the formula object does refer to a version that has not yet been installed, but we were not looking into Formula#prefix, but #linked_keg, which is version agnostic (since the original patch was committed, we Tab#for_formula learned to look into #opt_prefix as well). The rest of the logic is already embedded in the Tab accessors.
-rw-r--r--Library/Homebrew/cmd/upgrade.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb
index c63a535fe..b5effee50 100644
--- a/Library/Homebrew/cmd/upgrade.rb
+++ b/Library/Homebrew/cmd/upgrade.rb
@@ -43,10 +43,7 @@ module Homebrew extend self
end
def upgrade_formula f
- # Generate using `for_keg` since the formula object points to a newer version
- # that doesn't exist yet. Use `opt_prefix` to guard against keg-only installs.
- # Also, guard against old installs that may not have an `opt_prefix` symlink.
- tab = (f.opt_prefix.exist? ? Tab.for_keg(f.opt_prefix) : Tab.dummy_tab(f))
+ tab = Tab.for_formula(f)
outdated_keg = Keg.new(f.linked_keg.realpath) rescue nil
installer = FormulaInstaller.new(f)