curl-users
Re: Patch for Metalink Support
Date: Tue, 03 Mar 2009 23:54:34 +0900
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
Finally, I created 2nd patch.
I tried to put metalink functions in a separate file, but many
convenient functions and struct is defined in static in main.c(are there
any plan to make these functions non-static?), in this patch, sorry but
I put all metalink functions in main.c. The actual metalink download
code is separated from the original function(operate function), making
the existing code as unchanged as possible.
The metalink download function is called operatemetalink, which I
modified operate function to suit Metalink transfer and removed some
elements: file upload, url globbing.
In Metalink download, I choose file[@name] attribute in Metalink XML as
the default filename. In this patch, the default behavior is dump
received data to stdout. If --remote-name-all is specified, the above
mentioned file[@name] attribute is used as a filename. I admit that the
reusing the --remote-name-all option is wrong here, the new dedicated
option has to be added for this purpose.
To specify Metalink, use --metalink option. You can use this option more
than once to specify more than one metalink file. The modified curl
downloads files in metalink sequentially.
For example, to download openSUSE DVD, after downloading its metalink
file, issue the following command:
curl --remote-name-all -C - -f -l --connect-timeout 10 --metalink
openSUSE-11.1-DVD-i586.iso.metalink
Best regards,
Tatsuhiro Tsujikawa
Tatsuhiro Tsujikawa wrote:
> Daniel Stenberg wrote:
>> On Sat, 13 Dec 2008, Tatsuhiro Tsujikawa wrote:
>>
>> I would like to play around with this patch and functionality a bit,
>> but I have an initial request:
>>
>> I'd like this patch to have as low impact as possible on the existing
>> code so I would really like to see perhaps a separate file added with
>> the necessary metalink support functions or similar, so that all devs
>> and users who don't care for metalink wouldn't have to see many traces
>> of it.
>>
>
> OK. In my first patch, all metalink functions were integrated in main.c.
> I'll make new patch that call metalink function in another file after
> options are parsed.
>
> Best regards,
>
> Tatsuhiro Tsujikawa
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkmtRKoACgkQfoQD1dZzw2ZFJQCcC/4DkH2FcfwrWvqGpsLEE4tp
vMkAn2vrY9pYUl4HkRDskQEk/CWC2EQg
=yZJ5
-----END PGP SIGNATURE-----
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
- text/x-patch attachment: curl-7.19.4-metalink.patch