From 2c20e3b8dee5979210616742e5d19511eb7d0c9d Mon Sep 17 00:00:00 2001 From: Carlo Cabrera Date: Wed, 13 Nov 2024 09:43:16 +0800 Subject: [PATCH] os/mac/diagnostic: check for OpenCore This configuration is not supported. Let's make `brew doctor` complain about it. --- Library/Homebrew/extend/os/mac/diagnostic.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index 0b993813a8ca3..c13c5b5956eb3 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -128,6 +128,20 @@ def check_for_unsupported_macos EOS end + def check_for_opencore + has_opencore = + File.exist?("/Library/PrivilegedHelperTools/com.dortania.opencore-legacy-patcher.privileged-helper") + has_opencore ||= File.exist?("/Library/Application Support/Dortania/OpenCore-Patcher.app") + has_opencore ||= MacOS.pkgutil_info("com.dortania.opencore-legacy-patcher").present? + return unless has_opencore + + <<~EOS + You have installed macOS using OpenCore Legacy Patcher. + We do not provide support for this configuration. + #{please_create_pull_requests} + EOS + end + def check_xcode_up_to_date return unless MacOS::Xcode.outdated?