list ports that depend on a given port

Gregory Anders greg at gpanders.com
Fri Jun 4 19:53:42 UTC 2021


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.

Greg


More information about the macports-dev mailing list