From 1da26d89ea2d2cf5a45c8852288291de6a13d184 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Mon, 9 Nov 2009 17:44:29 +0000 Subject: Don't use Kernel.system much It just seems to behave strangely with SIGINT. Eg. SIGINT causes tar to exit, but the SIGINT is ignored by our process. This is not the case when used with curl. --- Library/Homebrew/formula_installer.rb | 2 +- Library/Homebrew/test/unittest.rb | 18 ++++++++++++++++++ Library/Homebrew/utils.rb | 22 ++++++++++++---------- 3 files changed, 31 insertions(+), 11 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 498029d2f..9ab03c11f 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -60,7 +60,7 @@ class FormulaInstaller exit! 1 end end - ignore_interrupts do + ignore_interrupts do # because child proc will get it and marshall it back write.close Process.wait data = read.read diff --git a/Library/Homebrew/test/unittest.rb b/Library/Homebrew/test/unittest.rb index bfa84bfd9..90d9ecdbc 100755 --- a/Library/Homebrew/test/unittest.rb +++ b/Library/Homebrew/test/unittest.rb @@ -30,6 +30,24 @@ MACOS_VERSION=10.6 Dir.chdir HOMEBREW_PREFIX at_exit { HOMEBREW_PREFIX.parent.rmtree } +# for some reason our utils.rb safe_system behaves completely differently +# during these tests. This is worrying for sure. +def safe_system *args + Kernel.system *args +end + +class ExecutionError