use Utils.popen_read instead of ENV trick to escape path
Closes Homebrew/homebrew#45021. Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
parent
646f94adfe
commit
b743cadd87
@ -164,11 +164,10 @@ module MachO
|
|||||||
end
|
end
|
||||||
|
|
||||||
def parse_otool_L_output
|
def parse_otool_L_output
|
||||||
ENV["HOMEBREW_MACH_O_FILE"] = path.expand_path.to_s
|
args = ["-L", path.expand_path.to_s]
|
||||||
libs = `#{MacOS.otool} -L "$HOMEBREW_MACH_O_FILE"`.split("\n")
|
libs = Utils.popen_read(OS::Mac.otool, *args).split("\n")
|
||||||
unless $?.success?
|
unless $?.success?
|
||||||
raise ErrorDuringExecution.new(MacOS.otool,
|
raise ErrorDuringExecution.new(OS::Mac.otool, args)
|
||||||
["-L", ENV["HOMEBREW_MACH_O_FILE"]])
|
|
||||||
end
|
end
|
||||||
|
|
||||||
libs.shift # first line is the filename
|
libs.shift # first line is the filename
|
||||||
@ -177,8 +176,6 @@ module MachO
|
|||||||
libs.map! { |lib| lib[OTOOL_RX, 1] }.compact!
|
libs.map! { |lib| lib[OTOOL_RX, 1] }.compact!
|
||||||
|
|
||||||
return id, libs
|
return id, libs
|
||||||
ensure
|
|
||||||
ENV.delete "HOMEBREW_MACH_O_FILE"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user