Search for port contents for any port...?

René J.V. Bertin rjvbertin at
Sat Apr 4 02:33:15 PDT 2015

On Friday April 03 2015 23:01:14 Jeremy Lavergne wrote:


I rarely have need for this kind of thing myself. I do see an interest for knowing the install size of a port and its dependencies. It's a pity that MacPorts cannot really provide that kind of information. On Linux, seeing the amount of stuff to be pulled in has often held me back from simply having a look at something.

>You can manually achieve this if prebuilt archives of the software are distributable. You would download the archive and list the contents. For example, to see what's in qt5-mac you would:

That is, distributable and presuming you are interested in the default variant because only those are built.

For all other cases, you have to do part of the work yourself:

%1> sudo port -y destroot foo [+variant1[+variant2]]

to see the list of dependencies that might have to be installed or upgraded to be able to build or install foo

%2> sudo port -n destroot foo [+variant1[+variant2]]

Note the -n here, which is to prevent pulling in or upgrading those dependencies (that you may not want). You'll probably need to install the dependencies in order to build foo, though.

When the destroot is done, you can

%3a> ls -l `port work foo`/destroot

or peruse the to-be-installed files in the Finder:

%3b> open `port work foo`/destroot

The good thing with this is that if you like what you see, you can then do

%4a> sudo port install foo [+variant1[+variant2]]

without having to wait for a download or rebuild. Also, having conflicting ports installed usually won't prevent you from doing the destroot step (unless there are build conflicts). 
Or you do

%4b> sudo port clean foo

when you decide you don't want foo. Uninstall any of the dependencies install in step 2 the usual way.

As you see, it's usually easier just to install a port, possibly using a version of step 1 above to see what other things would get pulled in, and see "in situ". Chances that you mess up something are small.


More information about the macports-users mailing list