How do you get the ports directory for a port via a script?

Jeremy Lavergne jeremy at
Sun Dec 2 09:33:45 PST 2012

> with another port.  The one thing I'm missing is how (via a script)
> to get the directory (e.g., textproc for ispell) that the port is
> in.  Is there a way (that I missed while doing my RTFM), via the
> 'port' command or some other ports-related command, to get the
> directory name (from either root or some fixed path)?
> port dir <portname> ? 
> host140:10142 Z# port dir ispell
> /opt/local/var/macports/sources/

That or port contents <portname> if you're looking for what was installed.

I saw /usr/local in your message... good luck :-)

More information about the macports-users mailing list