diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index e920ab35f0..607e69ec92 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -324,9 +324,7 @@ module Homebrew build_options = f.build fi = FormulaInstaller.new(f, force_bottle: args.force_bottle?, - include_test: args.include_test?, include_test_formulae: args.include_test_formulae, - build_from_source: args.build_from_source?, build_from_source_formulae: args.build_from_source_formulae) fi.options = build_options.used_options fi.env = args.env diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 980ff92b92..d9b5e6d1c3 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -44,14 +44,13 @@ class FormulaInstaller :installed_as_dependency, :installed_on_request, :link_keg, :other_installers mode_attr_accessor :show_summary_heading, :show_header - mode_attr_accessor :build_from_source, :force_bottle, :include_test - mode_attr_accessor :ignore_deps, :only_deps, :interactive, :git, :force, :keep_tmp + mode_attr_accessor :force_bottle, :ignore_deps, :only_deps, :interactive, :git, :force, :keep_tmp mode_attr_accessor :verbose, :debug, :quiet def initialize(formula, force_bottle: false, - include_test: false, include_test_formulae: [], - build_from_source: false, build_from_source_formulae: [], + include_test_formulae: [], + build_from_source_formulae: [], cc: nil) @formula = formula @env = nil @@ -61,12 +60,10 @@ class FormulaInstaller @show_header = false @ignore_deps = false @only_deps = false - @build_from_source = build_from_source @build_from_source_formulae = build_from_source_formulae @build_bottle = false @bottle_arch = nil @force_bottle = force_bottle - @include_test = include_test @include_test_formulae = include_test_formulae @interactive = false @git = false @@ -118,6 +115,14 @@ class FormulaInstaller raise BuildFlagsError.new(build_flags, bottled: all_bottled) end + def build_from_source? + build_from_source_formulae.include?(formula.full_name) + end + + def include_test? + include_test_formulae.include?(formula.full_name) + end + def build_bottle? return false unless @build_bottle @@ -596,9 +601,9 @@ class FormulaInstaller def fetch_dependency(dep) df = dep.to_formula - fi = FormulaInstaller.new(df, force_bottle: false, - include_test: include_test_formulae.include?(df.full_name), - build_from_source: build_from_source_formulae.include?(df.full_name)) + fi = FormulaInstaller.new(df, force_bottle: false, + include_test_formulae: include_test_formulae, + build_from_source_formulae: build_from_source_formulae) fi.force = force? fi.keep_tmp = keep_tmp? @@ -637,9 +642,9 @@ class FormulaInstaller EOS end - fi = FormulaInstaller.new(df, force_bottle: false, - include_test: include_test_formulae.include?(df.full_name), - build_from_source: build_from_source_formulae.include?(df.full_name)) + fi = FormulaInstaller.new(df, force_bottle: false, + include_test_formulae: include_test_formulae, + build_from_source_formulae: build_from_source_formulae) fi.options |= tab.used_options fi.options |= Tab.remap_deprecated_options(df.deprecated_options, dep.options) diff --git a/Library/Homebrew/reinstall.rb b/Library/Homebrew/reinstall.rb index 0e9f5ef038..77645bf7c0 100644 --- a/Library/Homebrew/reinstall.rb +++ b/Library/Homebrew/reinstall.rb @@ -24,7 +24,6 @@ module Homebrew options &= f.options fi = FormulaInstaller.new(f, force_bottle: args.force_bottle?, - build_from_source: args.build_from_source?, build_from_source_formulae: args.build_from_source_formulae) fi.options = options fi.force = args.force? diff --git a/Library/Homebrew/upgrade.rb b/Library/Homebrew/upgrade.rb index 3a9a211129..d447331884 100644 --- a/Library/Homebrew/upgrade.rb +++ b/Library/Homebrew/upgrade.rb @@ -63,8 +63,9 @@ module Homebrew options |= f.build.used_options options &= f.options - fi = FormulaInstaller.new(f, force_bottle: args.force_bottle?, include_test: args.include_test?, - build_from_source: args.build_from_source?) + fi = FormulaInstaller.new(f, force_bottle: args.force_bottle?, + include_test_formulae: args.include_test_formulae, + build_from_source_formulae: args.build_from_source_formulae) fi.options = options fi.force = args.force? fi.keep_tmp = args.keep_tmp?