aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2009-10-24 15:57:23 +0100
committerMax Howell2009-10-24 16:20:58 +0100
commit9d53d7b843b0b920974c01d0790dfe7621c7bc0d (patch)
treebb41695dbce1952fe9be1280dabe3e3b2b092bb0 /Library
parent5b288eee85238d96d9cfb42f02db72c7b0c858c4 (diff)
downloadhomebrew-9d53d7b843b0b920974c01d0790dfe7621c7bc0d.tar.bz2
Marshal install.rb exceptions back to the parent process
Using an error pipe. The use of ENV[HOMEBREW_ERROR_PIPE] feels wrong, but I wasn't sure how else to proxy the file descriptor to the child process since the fork immediately calls exec.
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Homebrew/install.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/Library/Homebrew/install.rb b/Library/Homebrew/install.rb
index f3ddd34bb..927e976bc 100755
--- a/Library/Homebrew/install.rb
+++ b/Library/Homebrew/install.rb
@@ -137,9 +137,16 @@ def install f
puts
rescue Exception => e
- #TODO propogate exception back to brew script
- onoe e
- puts e.backtrace
+ if ENV['HOMEBREW_ERROR_PIPE']
+ pipe = IO.new(ENV['HOMEBREW_ERROR_PIPE'].to_i, 'w')
+ Marshal.dump(e, pipe)
+ pipe.close
+ exit! 1
+ else
+ onoe e
+ puts e.backtrace
+ exit! 2
+ end
end