<div class="gmail_quote">On Fri, Jun 4, 2010 at 8:03 AM, Michael Wild <span dir="ltr"><<a href="mailto:themiwi@gmail.com">themiwi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
The log looks like this (I've put a message("log = ${log}") into ExternalProject.cmake to get this, since the numeric error code is 0):<br>
<br>
<snip><br>
-- downloading...<br>
src='<a href="http://downloads.sourceforge.net/project/freefoam/ThirdParty/zlib/zlib-1.2.5.tar.gz" target="_blank">http://downloads.sourceforge.net/project/freefoam/ThirdParty/zlib/zlib-1.2.5.tar.gz</a>'<br>
dst='/Users/mwild/Projects/FreeFOAM/build-pu/ThirdParty/zlib/src/zlib-1.2.5.tar.gz'<br>
timeout='none'<br>
log = About to connect() to <a href="http://downloads.sourceforge.net" target="_blank">downloads.sourceforge.net</a> port 80 (#0)<br>
Trying 216.34.181.59... connected<br>
Connected to <a href="http://downloads.sourceforge.net" target="_blank">downloads.sourceforge.net</a> (216.34.181.59) port 80 (#0)<br>
GET /project/freefoam/ThirdParty/zlib/zlib-1.2.5.tar.gz HTTP/1.1<br>
Host: <a href="http://downloads.sourceforge.net" target="_blank">downloads.sourceforge.net</a><br>
Accept: */*<br>
<br>
HTTP/1.1 302 Found<br>
X-Powered-By: PHP/5.2.9<br>
Content-Disposition: attachment; filename="zlib-1.2.5.tar.gz"<br>
Location: <a href="http://surfnet.dl.sourceforge.net/project/freefoam/ThirdParty/zlib/zlib-1.2.5.tar.gz
Content-type" target="_blank">http://surfnet.dl.sourceforge.net/project/freefoam/ThirdParty/zlib/zlib-1.2.5.tar.gz<br>
Content-type</a>: text/html<br>
Content-Length: 0<br>
Date: Fri, 04 Jun 2010 07:52:13 GMT<br>
Server: lighttpd/1.4.26<br>
<br>
Connection #0 to host <a href="http://downloads.sourceforge.net" target="_blank">downloads.sourceforge.net</a> left intact<br>
Closing connection #0<br>
<br>
-- downloading... done<br>
</snip><br>
<br>
So you see, CMake really thinks this succeeded.<br></blockquote><div><br></div><div>Hmm. I wonder if there's some sort of curl option we should be passing to get redirects to work automatically...?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
I really am looking forward to the EXPECTED_MD5 feature, please also make it available through ExternalProject_Add! Currently I'm doing this manually via an additional step, but it's awfully fragile...<br></blockquote>
<div><br></div><div>It is. That was actually the main motivation for the additional file(DOWNLOAD arg... In CMake 'next' there's a URL_MD5 arg to ExternalProject_Add now.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<font color="#888888"><br>
Michael<br>
</font><div><div></div><div class="h5"><br>
On 4. Jun, 2010, at 13:57 , David Cole wrote:<br>
<br>
> I'm pretty sure the original intent was for file(DOWNLOAD ...) to not raise<br>
> errors so that scripts can analyze status and log and decide what to do next<br>
> rather than forcing a CMake error...<br>
><br>
> I recently added EXPECTED_MD5 to file(DOWNLOAD in the 'next' branch of<br>
> CMake. If a download fails when there's an expected MD5 sum given, then it<br>
> *does* raise an error. Perhaps you'll find that useful in the next<br>
> release...<br>
><br>
> Cheers,<br>
> David C.<br>
><br>
><br>
> On Fri, Jun 4, 2010 at 7:55 AM, David Cole <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>> wrote:<br>
><br>
>> What if you do something this...? What do status and log tell you?<br>
>><br>
>> set(remote "http://......")<br>
>> set(local "some file name")<br>
>><br>
>> file(DOWNLOAD<br>
>><br>
>> "${remote}"<br>
>><br>
>> "${local}"<br>
>><br>
>> STATUS status<br>
>><br>
>> LOG log)<br>
>><br>
>><br>
>> list(GET status 0 status_code)<br>
>><br>
>> list(GET status 1 status_string)<br>
>><br>
>><br>
>> if(NOT status_code EQUAL 0)<br>
>><br>
>> message(FATAL_ERROR "error: downloading '${remote}' failed<br>
>><br>
>> status_code: ${status_code}<br>
>><br>
>> status_string: ${status_string}<br>
>><br>
>> log: ${log}<br>
>><br>
>> ")<br>
>><br>
>> endif()<br>
>><br>
>><br>
>><br>
>> On Fri, Jun 4, 2010 at 4:00 AM, Michael Wild <<a href="mailto:themiwi@gmail.com">themiwi@gmail.com</a>> wrote:<br>
>><br>
>>> When downloading something from <a href="http://downloads.sourceforge.net/." target="_blank">http://downloads.sourceforge.net/.</a>.. you<br>
>>> always get a 302 redirect to one of the many mirror servers. Unfortunately,<br>
>>> it seems that file(DOWNLOAD ...) doesn't follow the redirect, but just stops<br>
>>> and leaves an empty file behind. No error, no nothing. Is this intentional?<br>
>>><br>
>>> I'd rather not use a specific mirror...<br>
>>><br>
>>> Michael<br>
>>> _______________________________________________<br>
>>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>>><br>
>>> Visit other Kitware open-source projects at<br>
>>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>>><br>
>>> Please keep messages on-topic and check the CMake FAQ at:<br>
>>> <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
>>><br>
>>> Follow this link to subscribe/unsubscribe:<br>
>>> <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
>>><br>
>><br>
>><br>
<br>
</div></div></blockquote></div><br>