From 2e0a2cb1753edbd5ea1b5268c15ee4bba5693de1 Mon Sep 17 00:00:00 2001 From: Charlie Sharpsteen Date: Mon, 29 Aug 2011 14:55:28 -0700 Subject: [PATCH] formula.rb: Don't curl when DATA is the only patch Executing `curl(*patches)` was failing on Leopard when `patches` was an empty list. `git-bisect` identified 48552bb42a69ece4eb2a6d9acf81a0b47adb19c9 as the commit that caused this bug to surface by adding `--insecure` to the arg list on Leopard. This is odd because the following both exit with status 2: curl curl --insecure The only apparent difference is that `curl --insecure` prints "no URL specified!" to stderr along with the usage message. Also renamed `patches` to `external_patches` as it is more descriptive. --- Library/Homebrew/formula.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 53f8b94560..fd9bcbb728 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -594,10 +594,12 @@ EOF return if patch_list.empty? - ohai "Downloading patches" - # downloading all at once is much more efficient, especially for FTP - patches = patch_list.collect{|p| p[:curl_args]}.select{|p| p}.flatten - curl(*patches) + external_patches = patch_list.collect{|p| p[:curl_args]}.select{|p| p}.flatten + unless external_patches.empty? + ohai "Downloading patches" + # downloading all at once is much more efficient, especially for FTP + curl(*external_patches) + end ohai "Patching" patch_list.each do |p|