mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-15 19:56:59 +08:00
Doctor check for unlicensed Xcode
Checking the license text is probably the most future proofed method. Though for future reference other possible methods are listed in the below ticket. Closes Homebrew/homebrew#14558.
This commit is contained in:
parent
1555436f70
commit
b98c4792d0
@ -925,6 +925,16 @@ def check_os_version
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def check_xcode_license_approved
|
||||||
|
# If the user installs Xcode-only, they have to approve the
|
||||||
|
# license or no "xc*" tool will work.
|
||||||
|
<<-EOS.undent if `/usr/bin/xcrun clang 2>&1` =~ /license/ and not $?.success?
|
||||||
|
You have not agreed to the Xcode license.
|
||||||
|
Builds will fail! Agree to the license by opening Xcode.app or running:
|
||||||
|
xcodebuild -license
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
|
||||||
end # end class Checks
|
end # end class Checks
|
||||||
|
|
||||||
module Homebrew extend self
|
module Homebrew extend self
|
||||||
|
@ -37,8 +37,11 @@ module Homebrew extend self
|
|||||||
|
|
||||||
def check_xcode
|
def check_xcode
|
||||||
require 'cmd/doctor'
|
require 'cmd/doctor'
|
||||||
xcode = Checks.new.check_for_latest_xcode
|
checks = Checks.new
|
||||||
opoo xcode unless xcode.nil?
|
%w{check_for_latest_xcode check_xcode_license_approved}.each do |check|
|
||||||
|
out = checks.send(check)
|
||||||
|
opoo out unless out.nil?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_macports
|
def check_macports
|
||||||
|
Loading…
x
Reference in New Issue
Block a user