Proper way to clean up dependencies?

Joshua Root jmr at macports.org
Thu Jun 24 19:13:56 PDT 2010


On 2010-6-25 11:35 , Jim Busser wrote:
> On 2010-05-21, at 11:27 AM, Michael_google gmail_Gersten wrote:
> 
>> Running port clean on the main port does not clean the dependencies.
> 
> If one does
> 
> 	sudo port -f uninstall installed
> 
> it appears that each is followed by a "clean".

That's actually cleaning a separate work dir used for the portfile
stored in the registry.

> In the situation that a person was changing neither their hardware (i.e. not "retoring" a backup to some new machine) nor changing the installed Mac OS but only wishing to "start over" (for example, if they would alter build_arch), might it be a mistake to skip
> 
> 	sudo port clean --work --archive all
> 
> or would it be redundant and safe to skip?

Depends what you mean by "start over". If you don't clean --archive,
then of course if there is an archive present when you next install a
port, it will be extracted instead of building the port from source.
(Assuming archive mode is on.) If you changed build_arch, the result of
leaving the archives will just be a bit of wasted space.

If you don't clean --work, then if there is an existing work dir for a
port when you ask to install it, that work dir will be used instead of
starting from scratch. This will often lead to incorrect results if you
changed build_arch after starting the build.

It's a lot quicker to `sudo rm -rf
/opt/local/var/macports/{build,packages}/*` than to clean 'all', which
expands to every available port, not just ones you have ever done
anything with.

- Josh


More information about the macports-users mailing list