[MacPorts] howto/AvoidRedirects added

Rainer Müller raimue at macports.org
Mon Oct 29 13:46:05 PDT 2012


Hello,

thanks for your contribution! Please, add a link to this HOWTO to the
overview page, so others can find this new page.

https://trac.macports.org/wiki/howto

Thanks,
Rainer

On 2012-10-21 20:32, MacPorts wrote:
> Page "howto/AvoidRedirects" was added by ctreleaven at cogeco.ca
> Content:
> -------8<------8<------8<------8<------8<------8<------8<------8<--------
> [wiki:howto <- Back to the HOWTO section]
> 
> = How to build Avoid master_sites Redirects  =
> 
>  * Audience: Portfile authors 
>  * Requires: MacPorts >=2.0
> 
> == Introduction ==
> 
> In order to be a good 'Net citizen, it is worthwhile to minimize the load on other's servers.  One simple technique is to specify the `master_sites` parameter as specifically as possible so that the other side does not have to supply redirects in order to serve the file we want.  This how-to currently addresses only SourceForge.
> 
> == SourceForge ==
> 
> Hopefully, the following example, using mediainfo version 0.7.60, will illuminate the process.  The SourceForge home page for mediainfo is [[http://mediainfo.sourceforge.net]].  Initially, just specifying  `'master_sites  sourceforge'` in the portfile under development worked to retrieve the distfile.  The log for `'port fetch'` showed:
> 
> {{{
> DEBUG: Executing org.macports.fetch (mediainfo)
> --->  MediaInfo_CLI_0.7.60_GNU_FromSource.tar.bz2 doesn't seem to exist in /opt/local/var/macports/distfiles/mediainfo
> --->  Attempting to fetch MediaInfo_CLI_0.7.60_GNU_FromSource.tar.bz2 from http://iweb.dl.sourceforge.net/mediainfo
> }}}
> 
> Use 'curl -IL !http://iweb.dl.sourceforge.net/mediainfo/MediaInfo_CLI_0.7.60_GNU_FromSource.tar.bz2' to check for redirects.  In this case the output indicated redirects to a final address of:
> 
> {{{
> Location: http://voxel.dl.sourceforge.net/project/mediainfo/binary/mediainfo/0.7.60/MediaInfo_CLI_0.7.60_GNU_FromSource.tar.bz2
> }}}
> 
> To improve the `master_sites` parameter, extract the bit: `project/mediainfo/binary/mediainfo/0.7.60` (and replace "0.7.60"--the version number in this case--with ${version}).  Thus `'master_sites sourceforge:project/mediainfo/binary/mediainfo/${version}'`.
> 
> Pat yourself on the back--you're done!
> 
> 
> 
> [wiki:howto <- Back to the HOWTO section]
> -------8<------8<------8<------8<------8<------8<------8<------8<--------
> 
> --
> Page URL: <https://trac.macports.org/wiki/howto/AvoidRedirects>
> MacPorts <http://www.macports.org/>
> Ports system for Mac OS
> 
> This is an automated message. Someone added your email address to be
> notified of changes on 'howto/AvoidRedirects' page.
> If it was not you, please report to .
> _______________________________________________
> macports-changes mailing list
> macports-changes at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo/macports-changes
> 



More information about the macports-dev mailing list