diff options
| author | Jack Nagel | 2014-03-02 00:03:08 -0600 | 
|---|---|---|
| committer | Jack Nagel | 2014-03-02 00:03:08 -0600 | 
| commit | 4f63fc566ecaa9ddcb3e59a7ac5755260a0511b1 (patch) | |
| tree | 29b9632e47d99e629719c73519aaf40a190d11b8 | |
| parent | 1c7a66bf7f6c2f63288e4aff797638e1e518d10b (diff) | |
| download | homebrew-4f63fc566ecaa9ddcb3e59a7ac5755260a0511b1.tar.bz2 | |
Reduce the number of ways options can be passed to the installer
| -rw-r--r-- | Library/Homebrew/cmd/upgrade.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 16 | 
2 files changed, 7 insertions, 11 deletions
| diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 7682922b4..d222c5a98 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -63,7 +63,7 @@ module Homebrew extend self      outdated_keg = Keg.new(f.linked_keg.realpath) rescue nil      installer = FormulaInstaller.new(f) -    installer.tab = tab +    installer.options |= tab.used_options      installer.show_header = false      oh1 "Upgrading #{f.name}" diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index eb562c021..5b550fcdc 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -16,7 +16,7 @@ class FormulaInstaller    include FormulaCellarChecks    attr_reader :f -  attr_accessor :tab, :options, :ignore_deps, :only_deps +  attr_accessor :options, :ignore_deps, :only_deps    attr_accessor :show_summary_heading, :show_header    def initialize ff @@ -25,7 +25,6 @@ class FormulaInstaller      @ignore_deps = ARGV.ignore_deps? || ARGV.interactive?      @only_deps = ARGV.only_deps?      @options = Options.new -    @tab = Tab.dummy_tab(ff)      @@attempted ||= Set.new @@ -39,8 +38,7 @@ class FormulaInstaller    def pour_bottle? install_bottle_options={:warn=>false}      return false if @pour_failed -    tab.used_options.empty? && options.empty? && \ -      install_bottle?(f, install_bottle_options) +    options.empty? && install_bottle?(f, install_bottle_options)    end    def verify_deps_exist @@ -294,8 +292,9 @@ class FormulaInstaller      outdated_keg = Keg.new(df.linked_keg.realpath) rescue nil      fi = FormulaInstaller.new(df) -    fi.tab = Tab.for_formula(dep.to_formula) -    fi.options = dep.options | inherited_options +    fi.options |= Tab.for_formula(df).used_options +    fi.options |= dep.options +    fi.options |= inherited_options      fi.ignore_deps = true      fi.only_deps = false      fi.show_header = false @@ -374,10 +373,7 @@ class FormulaInstaller    def build_argv      opts = Options.coerce(ARGV.options_only) -    unless opts.include? '--fresh' -      opts.concat(options) # from a dependent formula -      opts.concat(tab.used_options) # from a previous install -    end +    opts.concat(options) unless opts.include? "--fresh"      opts << Option.new("--build-from-source") # don't download bottle    end | 
