From 915917f4d24541b0eee7f944066d444e338021c6 Mon Sep 17 00:00:00 2001 From: Lukas Eipert Date: Wed, 21 Aug 2024 13:19:57 +0200 Subject: [PATCH] Rosetta audit: Build full executable path The method only returned the executable name and not the full path, leading to a swallowed error, because brew gracefully ignores a failing lipo command. --- Library/Homebrew/cask/audit.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cask/audit.rb b/Library/Homebrew/cask/audit.rb index 23ee6c9748..9d97b00d1a 100644 --- a/Library/Homebrew/cask/audit.rb +++ b/Library/Homebrew/cask/audit.rb @@ -751,7 +751,12 @@ module Cask return unless File.exist?(plist_path) plist = system_command!("plutil", args: ["-convert", "xml1", "-o", "-", plist_path]).plist - plist["CFBundleExecutable"].presence + binary = plist["CFBundleExecutable"].presence + return unless binary + + binary_path = "#{path}/Contents/MacOS/#{binary}" + + binary_path if File.exist?(binary_path) && File.executable?(binary_path) end sig { void }