Diagnostic: require CLT headers on 10.14
This commit is contained in:
parent
95e3754b95
commit
e5212d74a6
@ -20,6 +20,7 @@ module Homebrew
|
|||||||
check_xcode_minimum_version
|
check_xcode_minimum_version
|
||||||
check_clt_minimum_version
|
check_clt_minimum_version
|
||||||
check_if_xcode_needs_clt_installed
|
check_if_xcode_needs_clt_installed
|
||||||
|
check_if_clt_needs_headers_installed
|
||||||
].freeze
|
].freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -135,6 +136,17 @@ module Homebrew
|
|||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def check_if_clt_needs_headers_installed
|
||||||
|
return unless MacOS::CLT.separate_header_package?
|
||||||
|
return if MacOS::CLT.headers_installed?
|
||||||
|
|
||||||
|
<<~EOS
|
||||||
|
The Command Line Tools header package must be installed on #{MacOS.version.pretty_name}.
|
||||||
|
The installer is located at:
|
||||||
|
#{MacOS::CLT::HEADER_PKG_PATH.sub(":macos_version", MacOS.version)}
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
|
||||||
def check_for_other_package_managers
|
def check_for_other_package_managers
|
||||||
ponk = MacOS.macports_or_fink
|
ponk = MacOS.macports_or_fink
|
||||||
return if ponk.empty?
|
return if ponk.empty?
|
||||||
|
|||||||
@ -32,6 +32,19 @@ describe Homebrew::Diagnostic::Checks do
|
|||||||
.to match("Xcode alone is not sufficient on El Capitan")
|
.to match("Xcode alone is not sufficient on El Capitan")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
specify "#check_if_clt_needs_headers_installed" do
|
||||||
|
allow(MacOS).to receive(:version).and_return(OS::Mac::Version.new("10.14"))
|
||||||
|
allow(MacOS::CLT).to receive(:installed?).and_return(true)
|
||||||
|
allow(MacOS::CLT).to receive(:headers_installed?).and_return(false)
|
||||||
|
|
||||||
|
expect(subject.check_if_clt_needs_headers_installed)
|
||||||
|
.to match("The Command Line Tools header package must be installed on Mojave.")
|
||||||
|
|
||||||
|
allow(MacOS).to receive(:version).and_return(OS::Mac::Version.new("10.13"))
|
||||||
|
expect(subject.check_if_clt_needs_headers_installed)
|
||||||
|
.to be_nil
|
||||||
|
end
|
||||||
|
|
||||||
specify "#check_homebrew_prefix" do
|
specify "#check_homebrew_prefix" do
|
||||||
# the integration tests are run in a special prefix
|
# the integration tests are run in a special prefix
|
||||||
expect(subject.check_homebrew_prefix)
|
expect(subject.check_homebrew_prefix)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user