From beac0409ca11090a1b96b6568bc3b9d2881bbab4 Mon Sep 17 00:00:00 2001
From: ant <ant@localhost.localdomain>
Date: Fri, 4 May 2012 00:00:32 -0400
Subject: [PATCH 1/4] Adds Metalink information to INSTALL

---
 docs/INSTALL |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/docs/INSTALL b/docs/INSTALL
index 137b64c..fbb7d1a 100644
--- a/docs/INSTALL
+++ b/docs/INSTALL
@@ -157,6 +157,9 @@ UNIX
      To get support for SCP and SFTP, build with --with-libssh2 and have
      libssh2 0.16 or later installed.
 
+     To get Metalink support, build with --with-libmetalink and have the 
+     libmetalink packages installed.
+
    SPECIAL CASES
    -------------
    Some versions of uClibc require configuring with CPPFLAGS=-D_GNU_SOURCE=1
-- 
1.7.7.6


From c26fd8a10e211f9f59f235158f26eed5e8c583cf Mon Sep 17 00:00:00 2001
From: ant <ant@localhost.localdomain>
Date: Fri, 4 May 2012 21:58:05 -0400
Subject: [PATCH 2/4] Add Metalink information and --metalink option to man
 page

---
 docs/curl.1 |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/docs/curl.1 b/docs/curl.1
index 02cfb44..4d9eafe 100644
--- a/docs/curl.1
+++ b/docs/curl.1
@@ -35,8 +35,8 @@ command is designed to work without user interaction.
 
 curl offers a busload of useful tricks like proxy support, user
 authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer
-resume and more. As you will see below, the number of features will make your
-head spin!
+resume, Metalink, and more. As you will see below, the number of features will
+make your head spin!
 
 curl is powered by libcurl for all transfer-related features. See
 .BR libcurl (3)
@@ -832,6 +832,15 @@ is used, this option can be used to prevent curl from following redirections
 option to -1 to make it limitless.
 
 If this option is used several times, the last one will be used.
+.IP "--metalink"
+Makes curl parse and process a local Metalink file (RFC 5854) and make use
+of the mirrors listed within for failover if there are errors (such as the
+file or server not being available).
+
+If Metalink support is enabled, curl will also use remote Metalinks if they
+are offered with the correct MIME type (application/metalink+xml).
+
+(Added in 7.??.?)
 .IP "-n, --netrc"
 Makes curl scan the \fI.netrc\fP (\fI_netrc\fP on Windows) file in the user's
 home directory for login name and password. This is typically used for FTP on
@@ -1689,6 +1698,8 @@ SSPI is supported. If you use NTLM and set a blank user name, curl will
 authenticate with your current user and password.
 .IP "TLS-SRP"
 SRP (Secure Remote Password) authentication is supported for TLS.
+.IP "Metalink"
+This curl supports Metalink (RFC 5854), which describes mirrors and hashes.
 .RE
 .SH FILES
 .I ~/.curlrc
-- 
1.7.7.6


From 5b4d414cf9448856e72eed46605c46ba1706e52e Mon Sep 17 00:00:00 2001
From: ant <ant@localhost.localdomain>
Date: Fri, 4 May 2012 22:18:33 -0400
Subject: [PATCH 3/4] Add Metalink information and --metalink option to man
 page

---
 docs/curl.1 |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/docs/curl.1 b/docs/curl.1
index 4d9eafe..c0215ba 100644
--- a/docs/curl.1
+++ b/docs/curl.1
@@ -833,14 +833,22 @@ option to -1 to make it limitless.
 
 If this option is used several times, the last one will be used.
 .IP "--metalink"
-Makes curl parse and process a local Metalink file (RFC 5854) and make use
+If curl is built against the libmetalink library then this option can tell
+curl to parse and process a local Metalink file (RFC 5854) and make use
 of the mirrors listed within for failover if there are errors (such as the
 file or server not being available).
 
+Example to use a local Metalink file:
+\fBcurl\fP --metalink example.metalink
+
 If Metalink support is enabled, curl will also use remote Metalinks if they
 are offered with the correct MIME type (application/metalink+xml).
 
-(Added in 7.??.?)
+Example to use a remote Metalink file:
+\fBcurl\fP -O http://www.example.com/example.metalink
+
+
+(Added in 7.??.?, disabled by default)
 .IP "-n, --netrc"
 Makes curl scan the \fI.netrc\fP (\fI_netrc\fP on Windows) file in the user's
 home directory for login name and password. This is typically used for FTP on
@@ -1700,6 +1708,8 @@ authenticate with your current user and password.
 SRP (Secure Remote Password) authentication is supported for TLS.
 .IP "Metalink"
 This curl supports Metalink (RFC 5854), which describes mirrors and hashes.
+curl will use mirrors for failover if there are errors (such as the file or
+server not being available).
 .RE
 .SH FILES
 .I ~/.curlrc
-- 
1.7.7.6


From b3b000db906ea9061e475c79604bef00c61a3fd6 Mon Sep 17 00:00:00 2001
From: ant <ant@localhost.localdomain>
Date: Fri, 4 May 2012 22:33:41 -0400
Subject: [PATCH 4/4] Add --metalink to --help

---
 src/tool_help.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/tool_help.c b/src/tool_help.c
index e7e6d6c..ac92469 100644
--- a/src/tool_help.c
+++ b/src/tool_help.c
@@ -125,6 +125,7 @@ static const char *const helptext[] = {
   "     --max-filesize BYTES  Maximum file size to download (H/F)",
   "     --max-redirs NUM  Maximum number of redirects allowed (H)",
   " -m, --max-time SECONDS  Maximum time allowed for the transfer",
+  "     --metalink      Process local Metalink file and use mirrors",
   "     --negotiate     Use HTTP Negotiate Authentication (H)",
   " -n, --netrc         Must read .netrc for user name and password",
   "     --netrc-optional Use either .netrc or URL; overrides -n",
-- 
1.7.7.6

