From 64cdda87e07a3a79e2e6cc97a01f6ca17650760e Mon Sep 17 00:00:00 2001 From: Max Howell Date: Tue, 15 Dec 2009 12:47:12 +0000 Subject: [PATCH] Be more quiet about checkouts unless ARGV.verbose? Fixes Homebrew/homebrew#204 --- Library/Homebrew/download_strategy.rb | 35 ++++++++++++++++++++------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 8cbb4cc5e1..e2a50b1d34 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -30,6 +30,26 @@ class AbstractDownloadStrategy end @unique_token="#{name}-#{version}" unless name.to_s.empty? or name == '__UNKNOWN__' end + + def expand_safe_system_args args + args.each_with_index do |arg, ii| + if arg.is_a? Hash + unless ARGV.verbose? + args[ii] = arg[:quiet_flag] + else + args.delete_at ii + end + return args + end + end + # 2 as default because commands are eg. svn up, git pull + args.insert(2, '-q') unless ARGV.verbose? + return args + end + + def quiet_safe_system *args + safe_system *expand_safe_system_args(args) + end end class CurlDownloadStrategy '-qq'}, @dl chdir when /^\037\213/, /^BZh/ # gzip/bz2 compressed # TODO check if it's really a tar archive @@ -113,9 +133,7 @@ class SubversionDownloadStrategy