| 19 | |
| 20 | == Fetching from a URL that uses GET parameters == #fetchwithgetparams |
| 21 | |
| 22 | Usually you set master_sites to the URL to the directory you want to download from, and at fetch time MacPorts appends a slash (if necessary) and the distfiles variable to this to create the complete URL. For example, [browser:trunk/dports/archivers/bzip2 bzip2] says |
| 23 | |
| 24 | {{{ |
| 25 | name bzip2 |
| 26 | version 1.0.5 |
| 27 | ... |
| 28 | homepage http://www.bzip.org/ |
| 29 | master_sites ${homepage}${version} |
| 30 | }}} |
| 31 | |
| 32 | so master_sites evaluates to !http://www.bzip.org/1.0.5, distfiles is the default bzip2-1.0.5.tar.gz, so the final URL MacPorts will download from is !http://www.bzip.org/1.0.5/bzip2-1.0.5.tar.gz. |
| 33 | |
| 34 | But sometimes the only download URL available is one that requires GET parameters, for example if you want to download an attachment from a Trac wiki. In this case, list the entire download URL in master_sites, and at the end, leave an empty dummy parameter. MacPorts will still append the slash and the distname, but since it'll be assigned to the dummy GET parameter, the server won't mind. This example is from [browser:trunk/dports/devel/gtkimageview gtkimageview]: |
| 35 | |
| 36 | {{{ |
| 37 | master_sites ${homepage}attachment/wiki/WikiStart/${distfiles}?format=raw&dummy= |
| 38 | }}} |