mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Merge pull request #20151 from Homebrew/fix-doctor-linux
Fix `brew doctor` cask handling on Linux
This commit is contained in:
commit
f238d3b494
@ -908,24 +908,21 @@ module Homebrew
|
|||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def check_deprecated_cask_taps
|
||||||
|
tapped_caskroom_taps = ::Tap.select { |t| t.user == "caskroom" || t.name == "phinze/cask" }
|
||||||
|
.map(&:name)
|
||||||
|
return if tapped_caskroom_taps.empty?
|
||||||
|
|
||||||
|
<<~EOS
|
||||||
|
You have the following deprecated Cask taps installed:
|
||||||
|
#{tapped_caskroom_taps.join("\n ")}
|
||||||
|
Please remove them with:
|
||||||
|
brew untap #{tapped_caskroom_taps.join(" ")}
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
|
||||||
def check_cask_software_versions
|
def check_cask_software_versions
|
||||||
add_info "Homebrew Version", HOMEBREW_VERSION
|
add_info "Homebrew Version", HOMEBREW_VERSION
|
||||||
add_info "macOS", MacOS.full_version
|
|
||||||
add_info "SIP", begin
|
|
||||||
csrutil = "/usr/bin/csrutil"
|
|
||||||
if File.executable?(csrutil)
|
|
||||||
Open3.capture2(csrutil, "status")
|
|
||||||
.first
|
|
||||||
.gsub("This is an unsupported configuration, likely to break in " \
|
|
||||||
"the future and leave your machine in an unknown state.", "")
|
|
||||||
.gsub("System Integrity Protection status: ", "")
|
|
||||||
.delete("\t.")
|
|
||||||
.capitalize
|
|
||||||
.strip
|
|
||||||
else
|
|
||||||
"N/A"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
@ -189,6 +189,13 @@ module OS
|
|||||||
are prone to breaking when GCC is updated. You should `brew reinstall` these formulae:
|
are prone to breaking when GCC is updated. You should `brew reinstall` these formulae:
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def check_cask_software_versions
|
||||||
|
super
|
||||||
|
add_info "Linux", OS::Linux.os_version
|
||||||
|
|
||||||
|
nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -424,18 +424,6 @@ module OS
|
|||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_deprecated_caskroom_taps
|
|
||||||
tapped_caskroom_taps = ::Tap.select { |t| t.user == "caskroom" || t.name == "phinze/cask" }
|
|
||||||
.map(&:name)
|
|
||||||
return if tapped_caskroom_taps.empty?
|
|
||||||
|
|
||||||
<<~EOS
|
|
||||||
You have the following deprecated, cask taps tapped:
|
|
||||||
#{tapped_caskroom_taps.join("\n ")}
|
|
||||||
Untap them with `brew untap`.
|
|
||||||
EOS
|
|
||||||
end
|
|
||||||
|
|
||||||
def check_if_supported_sdk_available
|
def check_if_supported_sdk_available
|
||||||
return unless ::DevelopmentTools.installed?
|
return unless ::DevelopmentTools.installed?
|
||||||
return unless MacOS.sdk_root_needed?
|
return unless MacOS.sdk_root_needed?
|
||||||
@ -496,6 +484,28 @@ module OS
|
|||||||
#{installation_instructions}
|
#{installation_instructions}
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def check_cask_software_versions
|
||||||
|
super
|
||||||
|
add_info "macOS", MacOS.full_version
|
||||||
|
add_info "SIP", begin
|
||||||
|
csrutil = "/usr/bin/csrutil"
|
||||||
|
if File.executable?(csrutil)
|
||||||
|
Open3.capture2(csrutil, "status")
|
||||||
|
.first
|
||||||
|
.gsub("This is an unsupported configuration, likely to break in " \
|
||||||
|
"the future and leave your machine in an unknown state.", "")
|
||||||
|
.gsub("System Integrity Protection status: ", "")
|
||||||
|
.delete("\t.")
|
||||||
|
.capitalize
|
||||||
|
.strip
|
||||||
|
else
|
||||||
|
"N/A"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user