diff options
| author | Xu Cheng | 2015-10-16 17:19:02 +0800 |
|---|---|---|
| committer | Xu Cheng | 2015-10-18 22:57:43 +0800 |
| commit | b743cadd873ac4ada7a5567000231e006eeb4591 (patch) | |
| tree | f3810160056bea085579fdd7e69fc0cb086f4ccc /Library/Homebrew/os/mac | |
| parent | 646f94adfef333c9ec5451fca55078de06ada3c0 (diff) | |
| download | brew-b743cadd873ac4ada7a5567000231e006eeb4591.tar.bz2 | |
use Utils.popen_read instead of ENV trick to escape path
Closes Homebrew/homebrew#45021.
Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library/Homebrew/os/mac')
| -rw-r--r-- | Library/Homebrew/os/mac/mach.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Library/Homebrew/os/mac/mach.rb b/Library/Homebrew/os/mac/mach.rb index 49382291c..b2060e375 100644 --- a/Library/Homebrew/os/mac/mach.rb +++ b/Library/Homebrew/os/mac/mach.rb @@ -164,11 +164,10 @@ module MachO end def parse_otool_L_output - ENV["HOMEBREW_MACH_O_FILE"] = path.expand_path.to_s - libs = `#{MacOS.otool} -L "$HOMEBREW_MACH_O_FILE"`.split("\n") + args = ["-L", path.expand_path.to_s] + libs = Utils.popen_read(OS::Mac.otool, *args).split("\n") unless $?.success? - raise ErrorDuringExecution.new(MacOS.otool, - ["-L", ENV["HOMEBREW_MACH_O_FILE"]]) + raise ErrorDuringExecution.new(OS::Mac.otool, args) end libs.shift # first line is the filename @@ -177,8 +176,6 @@ module MachO libs.map! { |lib| lib[OTOOL_RX, 1] }.compact! return id, libs - ensure - ENV.delete "HOMEBREW_MACH_O_FILE" end end |
