mirror_sites.tcl and `:nosubdir` tag

Joshua Root jmr at macports.org
Wed May 6 02:28:14 PDT 2015


On 2015-5-6 18:30 , petr wrote:
> 
> On 6 May 2015, at 05:56, Joshua Root <jmr at macports.org> wrote:
> 
>> 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
> 
> Thanks Josh,
> 
> is it then correct, that this tag (`:nosubdir`) is only effective if you use the mirror class in its plain form? I probably did not observe any effect because I use in in the form where i append `:<dirs>/`.
> 
> Example:
> 
> If you use 
> 
> master_sites    freebsd
> 
> this tag is evaluated
> 
> while if you use it in a form like
> 
> master_sites    pypi:o/obspy/
> 
> this has no effect anyway, because the subdir is never added and instead the string after `:` is added?

Yes, exactly. Well, except the string after the colon *is* a subdir. If
you specify a subdir explicitly, that overrides the nosubdir tag.

- Josh


More information about the macports-dev mailing list