diff options
| author | Max Howell | 2011-09-19 23:29:07 +0100 |
|---|---|---|
| committer | Max Howell | 2011-09-19 23:30:10 +0100 |
| commit | 06b554ac3f376da171ee68b627bb36a646c4826d (patch) | |
| tree | cbc29fd0da6f17cd249afe727b6aed84039a2446 /Library/Homebrew/utils.rb | |
| parent | 05209f7c75f693edf23d992b5a00409520d36de2 (diff) | |
| download | homebrew-06b554ac3f376da171ee68b627bb36a646c4826d.tar.bz2 | |
Only try mirrors for CurlDownloadStrategies
Also adjust output text slightly for prettiness.
A possibly useful side effect here is safe_system has a defined Exception (subclassing RuntimeError) now.
Diffstat (limited to 'Library/Homebrew/utils.rb')
| -rw-r--r-- | Library/Homebrew/utils.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 485995615..dc7bf5d42 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -92,7 +92,7 @@ end def safe_system cmd, *args unless Homebrew.system cmd, *args args = args.map{ |arg| arg.to_s.gsub " ", "\\ " } * " " - raise "Failure while executing: #{cmd} #{args}" + raise ErrorDuringExecution, "Failure while executing: #{cmd} #{args}" end end @@ -106,13 +106,13 @@ end def curl *args curl = Pathname.new '/usr/bin/curl' - raise "#{curl} is not an executable!" unless curl.exist? and curl.executable? + raise "#{curl} is not executable" unless curl.exist? and curl.executable? args = [HOMEBREW_CURL_ARGS, HOMEBREW_USER_AGENT, *args] # See https://github.com/mxcl/homebrew/issues/6103 args << "--insecure" if MacOS.version < 10.6 - raise DownloadError.new curl, args, $? unless Homebrew.system curl, *args + safe_system curl, *args end def puts_columns items, star_items=[] |
