Finding a port's dependencies

Elias Pipping pipping at
Sat Mar 31 13:03:04 PDT 2007

>>> I forget again: is there an easy way to tell if any
>>> ports depend on those?
>> yes, there is:
>> $grep :cairo-devel */*/Portfile
> I'll put this in the FAQ.  Would it be useful to make the port  
> command do
> this in a future revision?
> Mark

I've put together a script to search for dependents. Here's what it  

  * works on ports that aren't currently installed
  * supports both the (bin|lib):foo:name and the port:name syntax
  * matches the exact name [1]
    (searching for ncurses does not bring up results for ncursesw)
  * supports regexp [2]
    (e.g. searching for "ncursesw?")
  * finds dependencies that hide in variants
  * finds dependencies that hide in comments (yet to be gotten rid of)

setup:      the script needs to be run from within the dports folder.
invocation: ncursesw?

==== foo ====

#! /bin/sh

# room for customization

$GREP -E "(port|(lib|bin):[^:]+):$1([\t ]|$)" */*/Portfile | $SED "s=/ 

==== bar ====




More information about the macports-dev mailing list