aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-01-23 00:26:31 -0600
committerJack Nagel2013-01-26 12:14:51 -0600
commit7e8d1109107cdce5dcfd30ee489d0f58a7edb513 (patch)
tree86439d3284b362fed1a23843446c9bd669a2c937 /Library
parent7e8d3357896b893a6a7fa84c5bf7bfc146902ca6 (diff)
downloadhomebrew-7e8d1109107cdce5dcfd30ee489d0f58a7edb513.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.
Diffstat (limited to 'Library')
-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)