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.
This commit is contained in:
Charlie Sharpsteen 2011-08-29 14:55:28 -07:00
parent 864c81a61b
commit 2e0a2cb175

View File

@ -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|