From 6bd47cf0f96447e5ee0925eea34e406bdaed7ffa Mon Sep 17 00:00:00 2001 From: Max Howell Date: Mon, 19 Sep 2011 23:29:07 +0100 Subject: 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. --- Library/Homebrew/utils.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Library/Homebrew/utils.rb') 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=[] -- cgit v1.2.3