list ports that depend on a given port

Joshua Root jmr at macports.org
Fri Jun 4 21:29:26 UTC 2021


On 2021-6-5 05:53 , Gregory Anders wrote:
> On Fri, 04 Jun 2021 20:40 +0100, Christopher Jones wrote:
>>
>>> On 4 Jun 2021, at 8:14 pm, Gregory Anders <greg at gpanders.com> wrote:
>>>
>>> port echo depends:'(^|\W)boost(\W|$)’
>>
>> Thanks, that seems a bit better but it still matches port it should 
>> not. i.e. it matches
>>
>> py39-scikit-hep-hist
>>
>> which in fact only depends on
>>
>> > port deps py39-scikit-hep-hist
>> Full Name: py39-scikit-hep-hist @2.3.0_0
>> Fetch Dependencies:   git
>> Build Dependencies:   py39-setuptools
>> Library Dependencies: python39, py39-scikit-hep-boost-histogram
>> Test Dependencies:    py39-pytest
>>
>> Chris
> 
> Ah right, because the \W character in the regex I gave means a "non-word 
> character" which matches on the dash (it is equivalent to [^[:alnum:]_]).
> 
> So to exclude dashes we have to make it even uglier still:
> 
>      port echo depends:'(^|[^\w-])boost([^\w-]|$)'
> 
> Surely there is an easier way to do this... hopefully someone else will 
> chime in with a better solution.

Probably this (remember that it's matching the text in each depends_* 
field in the PortIndex): port echo depends:':boost(\s|$)'

To allow different matching styles in selectors, we would need some new 
syntax.

- Josh


More information about the macports-dev mailing list