diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index c023233651..4a4496fbd2 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -976,6 +976,7 @@ end def check_for_latest_xquartz quartz = MacOS::XQuartz.version return unless quartz + return if MacOS::XQuartz.provided_by_apple? quartz = Version.new(quartz) latest = Version.new(MacOS::XQuartz.latest_version) diff --git a/Library/Homebrew/macos/xquartz.rb b/Library/Homebrew/macos/xquartz.rb index 346fdd4123..6e64901fca 100644 --- a/Library/Homebrew/macos/xquartz.rb +++ b/Library/Homebrew/macos/xquartz.rb @@ -16,6 +16,12 @@ module MacOS::XQuartz extend self "2.7.4" end + def provided_by_apple? + [FORGE_BUNDLE_ID, APPLE_BUNDLE_ID].find do |id| + MacOS.app_with_bundle_id(id) + end == APPLE_BUNDLE_ID + end + # This should really be private, but for compatibility reasons it must # remain public. New code should use MacOS::XQuartz.{bin,lib,include} # instead, as that accounts for Xcode-only systems.