From 12e5e24ce36c2a222326c690ea9c77b1011681e9 Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Sat, 21 Jun 2025 21:59:14 -0400 Subject: [PATCH 1/2] Improve `brew doctor` warnings about `xattr` and cask quarantine --- Library/Homebrew/diagnostic.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 73d206b9fe..885108dd4b 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -1031,6 +1031,8 @@ module Homebrew end elsif result.stderr.include? "pkg_resources.DistributionNotFound" "Your Python installation is unable to find `xattr`." + elsif result.stderr.include? "No such file or directory" + "Unable to find `xattr`." else "unknown xattr error: #{result.stderr.split("\n").last}" end @@ -1044,6 +1046,8 @@ module Homebrew "No Cask quarantine support available: there's no working version of `xattr` on this system." when :no_swift "No Cask quarantine support available: there's no available version of `swift` on this system." + when :linux + "No Cask quarantine support available: not available on Linux." else "No Cask quarantine support available: unknown reason." end From 2acd4e42934bb9faef409b086d40efb35dbbd4c4 Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Sun, 22 Jun 2025 18:59:52 +0000 Subject: [PATCH 2/2] Improve messaging with missing `xattr` --- Library/Homebrew/diagnostic.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 885108dd4b..eb4bdef747 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -1009,6 +1009,8 @@ module Homebrew end def check_cask_xattr + return "Unable to find `xattr`." unless File.exist?("/usr/bin/xattr") + result = system_command "/usr/bin/xattr", args: ["-h"] return if result.status.success? @@ -1031,8 +1033,6 @@ module Homebrew end elsif result.stderr.include? "pkg_resources.DistributionNotFound" "Your Python installation is unable to find `xattr`." - elsif result.stderr.include? "No such file or directory" - "Unable to find `xattr`." else "unknown xattr error: #{result.stderr.split("\n").last}" end