Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Can I retrieve a list of the sizes of MacPorts installed packages?

Yes, I know they are compiled from sources, but if a list of generated files is known, it should be computable anyway.

share|improve this question

3 Answers 3

up vote 1 down vote accepted

You could make use of port build in command contents, which gives you the oportunity to do things like that:

port contents --size depof:python27

Grep the lines you need and do the maths :-)

Update: found answer here at guide.macports.

While reading a bit deeper, I found this

port space --units MB --total thisport

which is much more handy then calculating the sum of the size of each file inside a port.

share|improve this answer
    
I can't test it any more, so I'll just trust this to be correct. –  Lohoris Jun 19 at 12:11
1  
@Lohoris : much appreciated. Added link where I found this. –  Marco M. von Hagen Jun 19 at 14:24

Using the command:

du -sh /opt/local/var/macports/software/*

echos back all directories and sizes of your installed ports.

Use the command:

port -d echo installed

echoes a listing of the ports installed.

share|improve this answer
    
Oh. I didn't know they were neatly installed in separate directories :) –  Lohoris Oct 8 '11 at 12:13
    
Oh, they aren't. In those directories I just have the tarballs. I want to know the full current installed size. –  Lohoris Oct 8 '11 at 12:16

Well, by default they install to /opt/local so it should be as easy as cd /opt/local && du -sh * to get a list of the file sizes. Not sure if it's built into MP by default to give you overall sizes

share|improve this answer
    
Why not just du -sh /opt/local? –  EmmEff Oct 7 '11 at 15:06
    
That works as well, I like being in the directory to start tinkering so go down the cd path ;) –  Nicholas Smith Oct 7 '11 at 15:14
    
???. I'd like to know the single package size, not the sum of all the macports. –  Lohoris Oct 8 '11 at 12:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.