Split out os-specific cask software version checks

This commit is contained in:
Rylan Polster 2025-06-21 17:38:21 +00:00
parent dd04fb5ab6
commit 031160936f
No known key found for this signature in database
3 changed files with 29 additions and 16 deletions

View File

@ -910,22 +910,6 @@ module Homebrew
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

View File

@ -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

View File

@ -496,6 +496,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