From 2d4c792b0b6e74c06b9bc58ec93dbce50e89b67e Mon Sep 17 00:00:00 2001 From: Lukas Oberhuber Date: Tue, 26 Jul 2022 10:00:05 +0100 Subject: [PATCH] Make one function --- Library/Homebrew/extend/os/mac/keg.rb | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Library/Homebrew/extend/os/mac/keg.rb b/Library/Homebrew/extend/os/mac/keg.rb index cfe0b4f648..a6c03b82d7 100644 --- a/Library/Homebrew/extend/os/mac/keg.rb +++ b/Library/Homebrew/extend/os/mac/keg.rb @@ -64,19 +64,17 @@ class Keg end def dsymutil - binary_executable_or_library_files.each { |file| dsymutil_binary(file) } - end + binary_executable_or_library_files.each do |file| + odebug "Extracting symbols #{file}" - def dsymutil_binary(file) - odebug "Extracting symbols #{file}" + result = system_command("dsymutil", args: [file]) + next if result.success? - result = system_command("dsymutil", args: [file]) - return if result.success? - - # If it fails again, error out - onoe <<~EOS - Failed to extract symbols from #{file}: - #{result.stderr} - EOS + # If it fails again, error out + onoe <<~EOS + Failed to extract symbols from #{file}: + #{result.stderr} + EOS + end end end