aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharlie Sharpsteen2011-08-29 14:55:28 -0700
committerCharlie Sharpsteen2011-08-29 15:01:38 -0700
commit2e0a2cb1753edbd5ea1b5268c15ee4bba5693de1 (patch)
tree1f2d364c77ae59b6b92215fa8cb2bed7519b947e
parent864c81a61b230e2502d1f7c71c10de6f16c9e416 (diff)
downloadbrew-2e0a2cb1753edbd5ea1b5268c15ee4bba5693de1.tar.bz2
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.
-rw-r--r--Library/Homebrew/formula.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 53f8b9456..fd9bcbb72 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|