Updated to Git v1.8.4
[msysgit.git] / src / curl / patches / 0001-Eat-own-dog-food-use-cURL-to-download-CAs.patch
blob2fec1f25162c7d6641ccd78e920f028375361dbe
1 From a3eb8813c6ab6df4ead1533d956db16ff1df229a Mon Sep 17 00:00:00 2001
2 From: Johannes Schindelin <johannes.schindelin@gmx.de>
3 Date: Sat, 25 Jul 2009 17:36:51 +0200
4 Subject: [PATCH 1/3] Eat own dog food: use cURL to download CAs
6 This is because our installation of Perl doesn't include LWP but we do
7 have a version of curl already available.
9 Avoid trying to check the certificate when fetching the CA bundle.
10 As we are using curl and we don't have any CA certificates yet. This
11 doesn't work if we try checking the certificate chain.
13 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
14 Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
15 ---
16 lib/mk-ca-bundle.pl | 19 +------------------
17 1 file changed, 1 insertion(+), 18 deletions(-)
19 diff --git a/lib/mk-ca-bundle.pl b/lib/mk-ca-bundle.pl
20 index edede42..da441cd 100644
21 --- a/lib/mk-ca-bundle.pl
22 +++ b/lib/mk-ca-bundle.pl
23 @@ -32,7 +32,6 @@
25 use Getopt::Std;
26 use MIME::Base64;
27 -use LWP::UserAgent;
28 use strict;
29 use vars qw($opt_b $opt_f $opt_h $opt_i $opt_l $opt_n $opt_q $opt_t $opt_u $opt_v $opt_w);
31 @@ -55,8 +54,6 @@ if ($opt_i) {
32 print "Operating System Name : $^O\n";
33 print "Getopt::Std.pm Version : ${Getopt::Std::VERSION}\n";
34 print "MIME::Base64.pm Version : ${MIME::Base64::VERSION}\n";
35 - print "LWP::UserAgent.pm Version : ${LWP::UserAgent::VERSION}\n";
36 - print "LWP.pm Version : ${LWP::VERSION}\n";
37 print ("=" x 78 . "\n");
40 @@ -90,21 +87,7 @@ my $fetched;
42 unless ($opt_n and -e $txt) {
43 print STDERR "Downloading '$txt' ...\n" if (!$opt_q);
44 - my $ua = new LWP::UserAgent(agent => "$0/$version");
45 - $ua->env_proxy();
46 - $resp = $ua->mirror($url, $txt);
47 - if ($resp && $resp->code eq '304') {
48 - print STDERR "Not modified\n" unless $opt_q;
49 - exit 0 if -e $crt && !$opt_f;
50 - } else {
51 - $fetched = 1;
52 - }
53 - if( !$resp || $resp->code !~ /^(?:200|304)$/ ) {
54 - print STDERR "Unable to download latest data: "
55 - . ($resp? $resp->code . ' - ' . $resp->message : "LWP failed") . "\n"
56 - unless $opt_q;
57 - exit 1 if -e $crt || ! -r $txt;
58 - }
59 + `curl --insecure $url > $txt`;
62 my $currentdate = scalar gmtime($fetched ? $resp->last_modified : (stat($txt))[9]);
63 --
64 1.8.1.msysgit.1