From 2acd4e42934bb9faef409b086d40efb35dbbd4c4 Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Sun, 22 Jun 2025 18:59:52 +0000 Subject: [PATCH] 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