mirror_sites.tcl and `:nosubdir` tag

Joshua Root jmr at macports.org
Tue May 5 20:56:29 PDT 2015


On 2015-5-6 03:14 , petr wrote:
> 
> Hi all,
> 
> in ticket #47571 (https://trac.macports.org/ticket/47571) I am proposing a small addition to mirror_sites.tcl. However, I do not fully understand the function and use of the tag `:nosubdir`. There is some comment in the file
> 
> {{{
> # Appending :nosubdir as a tag to a mirror, means that
> # the portfetch target will NOT append a subdirectory to
> # the mirror site.
> }}}
> 
> but I still do not understand which effect it will have if this tag was appended. Can anybody comment on this!

Perhaps this is best answered with an example. If we set up a port like
this:

name		testport1
version		1.0
master_sites	apache

then we are using the apache mirror set, which is defined (in part) like
this:

set portfetch::mirror_sites::sites(apache) {
    http://mirrors.ibiblio.org/apache/

'port distfiles testport1' then shows us that the distfile will be
downloaded from (among others) this URL:

http://mirrors.ibiblio.org/apache/testport1/testport1-1.0.tar.gz

Notice that the port's name has been added as a subdir.

If we then change master_sites to:

master_sites	freebsd

which is defined like this:

set portfetch::mirror_sites::sites(freebsd) {
    http://distcache.FreeBSD.org/ports-distfiles/:nosubdir
}

we then see this from 'port distfiles':

http://distcache.FreeBSD.org/ports-distfiles/testport1-1.0.tar.gz

Which, as the name of the tag suggests, has no added subdir.

- Josh


More information about the macports-dev mailing list