Is there an easy way to find out which port loads which library?

Bernard Higonnet bthcom at higonnet.net
Sun Feb 17 22:14:49 UTC 2013


On 17-Feb-13 22:56, Chris Rees wrote:
>
> On 17 Feb 2013 17:31, "A.J. 'Fonz' van Werven" <fonz at skysmurf.nl
> <mailto:fonz at skysmurf.nl>> wrote:
>  >
>  > Bernard Higonnet wrote:
>  >
>  > > Is there a simple, direct, complete, and unequivocal way to find out
>  > > which port(s) install which libraries?
>  >
>  > Something like this perhaps?
>  > # grep libfoobar.so /usr/ports/*/*/pkg-plist
>
> Most shells won't allow an argument list that long.
>
> % find /usr/ports -depth 3 -name pkg-plist -exec grep libfoobar.so \{} \;
>
> has been shown to be faster than hacking around arg list limits with
> echo | xargs.
>
> Unfortunately neither method works with automatically generated plists....

I did in fact bump into too lengthy an argument list.

An alternative to your suggestion which worked for me was a for/do loop 
in bash.

Thanks to both
Bernard Higonnet



More information about the freebsd-ports mailing list