Pass args.cc to Install.

This commit is contained in:
Markus Reiter 2020-07-27 11:37:07 +02:00
parent ca18a72673
commit 20bd4280ff
6 changed files with 13 additions and 16 deletions

View File

@ -144,8 +144,8 @@ module Homebrew
def gist_logs
gist_logs_args.parse
perform_preinstall_checks(all_fatal: true)
perform_build_from_source_checks(all_fatal: true)
Install.perform_preinstall_checks(all_fatal: true)
Install.perform_build_from_source_checks(all_fatal: true)
gistify_logs(args.resolved_formulae.first)
end
end

View File

@ -10,7 +10,6 @@ require "cli/parser"
require "upgrade"
module Homebrew
extend Install
extend Search
module_function
@ -256,7 +255,7 @@ module Homebrew
return if formulae.empty?
perform_preinstall_checks
Install.perform_preinstall_checks(cc: args.cc)
formulae.each do |f|
Migrator.migrate_if_needed(f, force: args.force?)

View File

@ -13,8 +13,6 @@ require "cask/macos"
require "upgrade"
module Homebrew
extend Install
module_function
def reinstall_args
@ -61,7 +59,7 @@ module Homebrew
FormulaInstaller.prevent_build_flags unless DevelopmentTools.installed?
perform_preinstall_checks
Install.perform_preinstall_checks
resolved_formulae, casks = args.resolved_formulae_casks
resolved_formulae.each do |f|

View File

@ -9,8 +9,6 @@ require "cask/utils"
require "cask/macos"
module Homebrew
extend Install
module_function
def upgrade_args
@ -79,7 +77,7 @@ module Homebrew
def upgrade_outdated_formulae(formulae)
FormulaInstaller.prevent_build_flags unless DevelopmentTools.installed?
perform_preinstall_checks
Install.perform_preinstall_checks
if formulae.blank?
outdated = Formula.installed.select do |f|

View File

@ -43,8 +43,8 @@ module Homebrew
FileUtils.ln_sf ld_so, brew_ld_so
end
def perform_preinstall_checks(all_fatal: false)
generic_perform_preinstall_checks(all_fatal: all_fatal)
def perform_preinstall_checks(all_fatal: false, cc: nil)
generic_perform_preinstall_checks(all_fatal: all_fatal, cc: cc)
symlink_ld_so
end
end

View File

@ -7,6 +7,8 @@ require "development_tools"
module Homebrew
module Install
module_function
def check_cpu
return if Hardware::CPU.intel? && Hardware::CPU.is_64_bit?
@ -37,8 +39,8 @@ module Homebrew
end
end
def check_cc_argv
return unless (cc = args.cc)
def check_cc_argv(cc)
return unless cc
@checks ||= Diagnostic::Checks.new
opoo <<~EOS
@ -47,10 +49,10 @@ module Homebrew
EOS
end
def perform_preinstall_checks(all_fatal: false)
def perform_preinstall_checks(all_fatal: false, cc: nil)
check_cpu
attempt_directory_creation
check_cc_argv
check_cc_argv(cc)
diagnostic_checks(:supported_configuration_checks, fatal: all_fatal)
diagnostic_checks(:fatal_preinstall_checks)
end