Download with confirmation ...

Ryan Schmidt ryandesign at macports.org
Fri Jul 19 19:56:41 PDT 2013


On Jul 19, 2013, at 12:50, Peter Danecek wrote:

> I am wondering if there is some nice way to automatically download from pages which require "filling a form", like the one below ...
> 
>    https://www.irods.org/download.html

Definitely not. MacPorts uses curl to do an HTTP GET on a URL to download a distfile. That's all.


> Or would I just refers to the URL in the ACTION attribute?
> 
>    http://irods.sdsc.edu/cgi-bin/upload17.cgi/irods3.3.tgz

If that downloads the file, then sure.

And it appears that it does:

$ curl -I -L http://irods.sdsc.edu/cgi-bin/upload17.cgi/irods3.3.tgz
HTTP/1.1 301 Moved Permanently
Date: Sat, 20 Jul 2013 02:54:22 GMT
Server: Apache/2.2.3 (Red Hat) mod_ssl/2.2.3 OpenSSL/0.9.8e-fips-rhel5 PHP/5.2.5
Location: https://www.irods.org/cgi-bin/upload17.cgi/irods3.3.tgz
Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 200 OK
Date: Sat, 20 Jul 2013 02:54:22 GMT
Server: Apache/2.2.3 (Red Hat) mod_ssl/2.2.3 OpenSSL/0.9.8e-fips-rhel5 PHP/5.2.5
Content-Type: application/x-gzip

It also appears that you'll want to use that second URL (https://www.irods.org/cgi-bin/upload17.cgi/irods3.3.tgz) to avoid a redirect.


> The former URL does not include the version, so the provided tar-ball would change after an update, but the URL won't.
> 
> How this would be handled correctly? Any proposals?


Same as always. Put the URL of the directory containing the file in master_sites, and put the filename in distfiles.



More information about the macports-dev mailing list