Re: PortGroup vs. Portfile search strategy

2018-06-13 Thread René J . V . Bertin
After-thought: this is of course counter-productive for custom port trees that 
do not override the main tree but in which you want to use a custom version of 
an existing PortGroup.

One could think of making an optional check using `getportresourcepath` before 
scanning over all port trees; the option could be set in sources.conf . Would 
the existing code require many changes to allow an additional keyword (say 
`file:///path/to/custom_ports [nosync portgroups_here_first]`)?

R.


Re: PortGroup vs. Portfile search strategy

2018-06-13 Thread René J . V . Bertin
Thanks again, this patch seems to do what I want:

https://github.com/RJVB/macstrop/blob/master/sysutils/MacPorts/files/patch-hierarchical-portgroup-search.diff

R.


Re: PortGroup vs. Portfile search strategy

2018-06-13 Thread Rainer Müller
On 2018-06-12 21:20, René J.V. Bertin wrote:
> Rainer Müller wrote on 20180612::18:22:46 re: "Re: PortGroup vs. Portfile 
> search strategy"
> 
> Hi,
> 
>> The implementation of PortGroup is here:
>> https://github.com/macports/macports-base/blob/master/src/port1.0/portutil.tcl#L2509-L2535
> 
> Yeah, that one I was already familiar with. It's the hierarchical search 
> algorithm that scans all trees until it finds a hit that I'm looking for.
> 
> I guess I'll start by looking at the `port file` implementation.
> 
> R.

There is nothing exactly like that, as looking up a Portfile relies on
the PortIndex in each ports tree. The closest we have would probably be
mportlookup:

https://github.com/macports/macports-base/blob/0f35ebbacf5f2f3b8e9a3147d69191bb86cceb2b/src/macports1.0/macports.tcl#L3022

Rainer

PS: Please remember to use Reply All.


Re: PortGroup vs. Portfile search strategy

2018-06-12 Thread Rainer Müller
On 2018-06-12 10:43, René J.V. Bertin wrote:
> Where would I have to look if I wanted to make a local patch to "base" so 
> that PortGroup files are looked up with the same tree hierarchy as used for 
> Portfiles (i.e. search first in the default tree, not only in the current 
> tree and then the default tree)
The implementation of PortGroup is here:
https://github.com/macports/macports-base/blob/master/src/port1.0/portutil.tcl#L2509-L2535

Rainer