mach: improve otool failure handling.

This commit is contained in:
Mike McQuaid 2014-12-11 13:59:12 +00:00
parent 02e5f8ed6b
commit 56e82c941e

View File

@ -155,7 +155,10 @@ module MachO
def parse_otool_L_output def parse_otool_L_output
ENV["HOMEBREW_MACH_O_FILE"] = path.expand_path.to_s ENV["HOMEBREW_MACH_O_FILE"] = path.expand_path.to_s
libs = `#{MacOS.locate("otool")} -L "$HOMEBREW_MACH_O_FILE"`.split("\n") libs = `#{MacOS.locate("otool")} -L "$HOMEBREW_MACH_O_FILE"`.split("\n")
return nil, [] if libs.empty? unless $?.success?
raise ErrorDuringExecution.new(MacOS.locate("otool"),
["-L", ENV["HOMEBREW_MACH_O_FILE"]])
end
libs.shift # first line is the filename libs.shift # first line is the filename