Improve messaging with missing xattr

This commit is contained in:
Rylan Polster 2025-06-22 18:59:52 +00:00 committed by GitHub
parent 12e5e24ce3
commit 2acd4e4293
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1009,6 +1009,8 @@ module Homebrew
end end
def check_cask_xattr def check_cask_xattr
return "Unable to find `xattr`." unless File.exist?("/usr/bin/xattr")
result = system_command "/usr/bin/xattr", args: ["-h"] result = system_command "/usr/bin/xattr", args: ["-h"]
return if result.status.success? return if result.status.success?
@ -1031,8 +1033,6 @@ module Homebrew
end end
elsif result.stderr.include? "pkg_resources.DistributionNotFound" elsif result.stderr.include? "pkg_resources.DistributionNotFound"
"Your Python installation is unable to find `xattr`." "Your Python installation is unable to find `xattr`."
elsif result.stderr.include? "No such file or directory"
"Unable to find `xattr`."
else else
"unknown xattr error: #{result.stderr.split("\n").last}" "unknown xattr error: #{result.stderr.split("\n").last}"
end end