Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Apr 2021 14:55:07 -0300
From:      Mario Lobo <lobo@bsd.com.br>
To:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: Cleaning Ports Tree
Message-ID:  <CA%2ByoEx90D%2B6ts2EFo_wKB-yTxtPD6LLZ-RLbwLgvqWpVekA=PA@mail.gmail.com>
In-Reply-To: <5996718.nAnukg6brD@ravel>
References:  <0a04f310-af5c-371c-0940-1b0af0f5aca4@tundraware.com> <5996718.nAnukg6brD@ravel>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Apr 16, 2021 at 2:48 PM Olivier Certner <olivier.freebsd@free.fr>
wrote:

> Hi,
>
> >   find  /usr/ports -type d -name work -exec -vrf {} \;
> >
> > This second approach is much, much (much) faster, I just want to make
> > sure I am not creating nasty side-effects thereby.
>
> It is faster indeed. Even faster, and taking flavors into account:
> find /usr/ports -depth 3 -name 'work*' -exec rm -fR "{}" +
> (And, you could improve it again by using `xargs -P`).
>
> There are no side-effects. No ports currently overrides do-clean, nor uses
> the
> pre and post clean targets, which have existed for more than 20 years, and
> I'm
> willing to bet it's not going to change.
>
> Yasuhiro pointed out some guaranteed advantages of `make clean`, but in
> fact
> you get point 1 with the above command, and point 2 is usually not really
> a
> problem (you could wrap the `find` command inside some shell script
> testing
> for WRKDIRPREFIX, in the case it is not set, and use a simple `rm -fR`
> when it
> is, after appropriate sanity checks that is; but I don't think this is
> worth
> the trouble).
>
> Regards.
>
> --
> Olivier Certner
>
>
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "
> freebsd-questions-unsubscribe@freebsd.org"
>


ports-mgmt/portupgrade has a utility (portsclean) that does exactly that
among other things, like cleaning unreferenced distfiles, and more.

-- 
Mario Lobo
http://www.mallavoodoo.com.br
FreeBSD since version 2.2.8 [not Pro-Audio.... YET!!]



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2ByoEx90D%2B6ts2EFo_wKB-yTxtPD6LLZ-RLbwLgvqWpVekA=PA>