aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2012-03-23 13:05:08 -0500
committerJack Nagel2012-03-23 13:05:08 -0500
commitf8fefcc51e78128c152e9bf2150b57e00926896f (patch)
tree903c7c7c02473152eebafd1781177d2c57ff06f4 /Library
parent672c5ab20b77f590c8d8d1ac207b6298f23c7410 (diff)
downloadhomebrew-f8fefcc51e78128c152e9bf2150b57e00926896f.tar.bz2
Pass the tab to FormulaInstaller
Callers of FormulaInstaller now usually unlink the existing keg prior to running the installer. However, Tab.for_formula uses the LinkedKeg record to obtain the tab. Since we need the tab to persist install options across upgrades, we must start creating the Tab object before unlinking the old keg and passing it to the FormulaInstaller. Fixes #11086. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/upgrade.rb3
-rw-r--r--Library/Homebrew/formula_installer.rb10
2 files changed, 8 insertions, 5 deletions
diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb
index 9777c5ce5..671188a3c 100644
--- a/Library/Homebrew/cmd/upgrade.rb
+++ b/Library/Homebrew/cmd/upgrade.rb
@@ -49,9 +49,10 @@ module Homebrew extend self
end
def upgrade_formula f
+ tab = Tab.for_formula(f)
outdated_keg = Keg.new(f.linked_keg.realpath) rescue nil
- installer = FormulaInstaller.new f
+ installer = FormulaInstaller.new(f, tab)
installer.show_header = false
oh1 "Upgrading #{f.name}"
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index cd911b959..266f518df 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -7,13 +7,15 @@ require 'bottles'
class FormulaInstaller
attr :f
+ attr :tab
attr :show_summary_heading, true
attr :ignore_deps, true
attr :install_bottle, true
attr :show_header, true
- def initialize ff
+ def initialize ff, tab=nil
@f = ff
+ @tab = tab
@show_header = true
@ignore_deps = ARGV.include? '--ignore-dependencies' || ARGV.interactive?
@install_bottle = install_bottle? ff
@@ -111,9 +113,10 @@ class FormulaInstaller
end
def install_dependency dep
+ dep_tab = Tab.for_formula(dep)
outdated_keg = Keg.new(dep.linked_keg.realpath) rescue nil
- fi = FormulaInstaller.new dep
+ fi = FormulaInstaller.new(dep, dep_tab)
fi.ignore_deps = true
fi.show_header = false
oh1 "Installing #{f} dependency: #{dep}"
@@ -179,8 +182,7 @@ class FormulaInstaller
args = ARGV.clone
unless args.include? '--fresh'
- previous_install = Tab.for_formula f
- args.concat previous_install.used_options
+ args.concat tab.used_options unless tab.nil?
args.uniq! # Just in case some dupes were added
end