https://plus.google.com/u/0/104655879466016602043/posts/6i9FYt9BeiY

Tatsuhiro's explanation & help compiling curl w/ metalink support:

Curl 7.27.0 was out few days ago. This release is important to us because 
it is the first public curl release which supports Metalink.
http://en.wikipedia.org/wiki/Metalink
Thank you to curl community, especially Daniel Stenberg who accepted 
Metalink patch, Yang Tse who quickly merged our patch and provided security 
enhancement ideas and many test cases for Metalink feature and Guenter 
Knauf who provided many libmetalink enhancement patches which fixes many 
portability issues.

Since Metalink feature in curl is optional at the moment, I'll write a 
simple tutorial to get it work. First grab libmetalink-0.1.0 tar ball.
https://launchpad.net/libmetalink/trunk/libmetalink-0.1.0/+download/libmetalink-0.1.0.tar.bz2
(Please note that libmetalink-0.0.3 does not work with curl).
Libmetalink depends on Expat XML library. If you are using Ubuntu, install 
libexpat-dev package. Unpack libmetalink tar ball and configure and make 
install.

Probably one of most appealing point of Metalink is automatic checksum 
validation. To do this, curl must be built with OpenSSL or GnuTLS.
For OpenSSL, install libssl-dev.

After libmetalink was installed, download curl 7.27.0 source tar ball.
Unpack it and run configure script with --with-libmetalink option.
Make sure that metalink support is enabled. If it is enabled, you can see 
the following line in the output of configure script:

  metalink support: enabled

Then run make to build curl tool binary.

To download a file using Metalink feature, provide URI to Metalink file.
Curl download page offers several Metalink downloads. Let's use it as an 
example. Use --metalink option to enable Metalink feature.

$ src/curl --metalink 'http://curl.haxx.se/metalink.cgi?curl=tar.bz2'
Metalink: parsing (http://curl.haxx.se/metalink.cgi?curl=tar.bz2) 
metalink/XML...
Metalink: parsing (http://curl.haxx.se/metalink.cgi?curl=tar.bz2) OK

[1/12]: http://curl.freeby.pctools.cl/download/curl-7.27.0.tar.bz2 --> 
curl-7.27.0.tar.bz2
--*curl*--http://curl.freeby.pctools.cl/download/curl-7.27.0.tar.bz2
Metalink: fetching (curl-7.27.0.tar.bz2) from (
http://curl.freeby.pctools.cl/download/curl-7.27.0.tar.bz2)...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time 
 Current
                                 Dload  Upload   Total   Spent    Left 
 Speed
100 2418k  100 2418k    0     0   191k      0  0:00:12  0:00:12 --:--:-- 
 134k
Metalink: fetching (curl-7.27.0.tar.bz2) from (
http://curl.freeby.pctools.cl/download/curl-7.27.0.tar.bz2) OK
Metalink: validating (curl-7.27.0.tar.bz2)...
Metalink: validating (curl-7.27.0.tar.bz2) OK

OK, I'll explain what happened behind the scene.
First, curl downloaded metalink XML file pointed by URI '
http://curl.haxx.se/metalink.cgi?curl=tar.bz2'.
The content of XML file was not saved on the disk. It was parsed on the fly.
After the XML file was downloaded and parsed, curl retrieves mirror URIs 
from the parsed result and download the file pointed by it. In this 
example, the Metalink XML file contains 12 URIs. These URIs are used as 
fallback.
As a first attempt, curl used 
http://curl.freeby.pctools.cl/download/curl-7.27.0.tar.bz2 to download curl 
7.27.0 tar ball. Unlike normal curl behavior, curl saves the file using the 
filename described in Metalink XML file. In this example, the filename is 
"curl-7.27.0.tar.bz2". -O option is not necessary.
After download completed, curl automatically calculated checksum of the 
download file and compared it with the correct one described in Metalink 
XML file and surely they were matched.


On Friday, July 27, 2012 6:27:50 PM UTC-4, Anthony Bryan wrote:
>
> Date: Fri, 27 Jul 2012 23:23:51 +0200 (CEST) 
> From: Daniel Stenberg <[email protected]> 
> To: Curl Announce -- curl users <[email protected]>, 
>         [email protected], libcurl hacking 
>         <[email protected]> 
> Subject: ANNOUNCE: curl and libcurl 7.27.0 
> Message-ID: <[email protected]> 
> Content-Type: text/plain; charset="iso-8859-15"; Format="flowed" 
>
> Friends! 
>
> Hurry on over to http://curl.haxx.se/download.html and download the fresh 
> release! This time with new features and two new SSL libraries supported. 
>
> Curl and libcurl 7.27.0 
>
> This release includes the following changes: 
>
>   o nss: use human-readable error messages provided by NSS 
>   o added --metalink for metalink download support [5]
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Metalink Discussion" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/metalink-discussion/-/m81rwP7gciMJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/metalink-discussion?hl=en.

Reply via email to