diagnostic: more porting to generic OS. (#449)
This commit is contained in:
parent
a1b0ef1300
commit
59074e91d6
@ -218,15 +218,9 @@ module Homebrew
|
|||||||
raise "Cannot write to #{HOMEBREW_PREFIX}" unless HOMEBREW_PREFIX.writable_real? || HOMEBREW_PREFIX.to_s == "/usr/local"
|
raise "Cannot write to #{HOMEBREW_PREFIX}" unless HOMEBREW_PREFIX.writable_real? || HOMEBREW_PREFIX.to_s == "/usr/local"
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_xcode
|
def check_development_tools
|
||||||
checks = Diagnostic::Checks.new
|
checks = Diagnostic::Checks.new
|
||||||
%w[
|
checks.all_development_tools_checks.each do |check|
|
||||||
check_for_unsupported_osx
|
|
||||||
check_for_bad_install_name_tool
|
|
||||||
check_for_installed_developer_tools
|
|
||||||
check_xcode_license_approved
|
|
||||||
check_for_osx_gcc_installer
|
|
||||||
].each do |check|
|
|
||||||
out = checks.send(check)
|
out = checks.send(check)
|
||||||
opoo out unless out.nil?
|
opoo out unless out.nil?
|
||||||
end
|
end
|
||||||
@ -252,7 +246,7 @@ module Homebrew
|
|||||||
def perform_preinstall_checks
|
def perform_preinstall_checks
|
||||||
check_ppc
|
check_ppc
|
||||||
check_writable_install_location
|
check_writable_install_location
|
||||||
check_xcode if MacOS.has_apple_developer_tools?
|
check_development_tools if DevelopmentTools.installed?
|
||||||
check_cellar
|
check_cellar
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -85,6 +85,21 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
############# END HELPERS
|
############# END HELPERS
|
||||||
|
|
||||||
|
def all_development_tools_checks
|
||||||
|
%w[
|
||||||
|
check_for_installed_developer_tools
|
||||||
|
]
|
||||||
|
end
|
||||||
|
|
||||||
|
def check_for_installed_developer_tools
|
||||||
|
return if DevelopmentTools.installed?
|
||||||
|
|
||||||
|
<<-EOS.undent
|
||||||
|
No developer tools installed.
|
||||||
|
Install clang or gcc.
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
|
||||||
# See https://github.com/Homebrew/legacy-homebrew/pull/9986
|
# See https://github.com/Homebrew/legacy-homebrew/pull/9986
|
||||||
def check_path_for_trailing_slashes
|
def check_path_for_trailing_slashes
|
||||||
all_paths = ENV["PATH"].split(File::PATH_SEPARATOR)
|
all_paths = ENV["PATH"].split(File::PATH_SEPARATOR)
|
||||||
|
|||||||
@ -1,6 +1,16 @@
|
|||||||
module Homebrew
|
module Homebrew
|
||||||
module Diagnostic
|
module Diagnostic
|
||||||
class Checks
|
class Checks
|
||||||
|
def all_development_tools_checks
|
||||||
|
%w[
|
||||||
|
check_for_unsupported_osx
|
||||||
|
check_for_bad_install_name_tool
|
||||||
|
check_for_installed_developer_tools
|
||||||
|
check_xcode_license_approved
|
||||||
|
check_for_osx_gcc_installer
|
||||||
|
]
|
||||||
|
end
|
||||||
|
|
||||||
def check_for_unsupported_osx
|
def check_for_unsupported_osx
|
||||||
return if ARGV.homebrew_developer?
|
return if ARGV.homebrew_developer?
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user