From 031160936f234f28b86d7f584afa1769636795eb Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Sat, 21 Jun 2025 17:38:21 +0000 Subject: [PATCH 1/2] Split out os-specific cask software version checks --- Library/Homebrew/diagnostic.rb | 16 -------------- .../Homebrew/extend/os/linux/diagnostic.rb | 7 ++++++ Library/Homebrew/extend/os/mac/diagnostic.rb | 22 +++++++++++++++++++ 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 2f701b22be..f8508cea3e 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -910,22 +910,6 @@ module Homebrew def check_cask_software_versions 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 end diff --git a/Library/Homebrew/extend/os/linux/diagnostic.rb b/Library/Homebrew/extend/os/linux/diagnostic.rb index 3cdf01a4d7..d03421e498 100644 --- a/Library/Homebrew/extend/os/linux/diagnostic.rb +++ b/Library/Homebrew/extend/os/linux/diagnostic.rb @@ -189,6 +189,13 @@ module OS are prone to breaking when GCC is updated. You should `brew reinstall` these formulae: EOS end + + def check_cask_software_versions + super + add_info "Linux", OS::Linux.os_version + + nil + end end end end diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index c3d92eb374..5b663e233b 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -496,6 +496,28 @@ module OS #{installation_instructions} EOS 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 From e1873d30d4789321c4060b01b6abe931ad05f967 Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Sat, 21 Jun 2025 17:41:24 +0000 Subject: [PATCH 2/2] Run deprecated cask tap check on all systems --- Library/Homebrew/diagnostic.rb | 13 +++++++++++++ Library/Homebrew/extend/os/mac/diagnostic.rb | 12 ------------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index f8508cea3e..73d206b9fe 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -908,6 +908,19 @@ module Homebrew EOS 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 add_info "Homebrew Version", HOMEBREW_VERSION diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index 5b663e233b..8c60b8ba30 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -424,18 +424,6 @@ module OS EOS 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 return unless ::DevelopmentTools.installed? return unless MacOS.sdk_root_needed?