Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Apr 2021 19:48:10 +0200
From:      Olivier Certner <olivier.freebsd@free.fr>
To:        freebsd-questions@freebsd.org
Subject:   Re: Cleaning Ports Tree
Message-ID:  <5996718.nAnukg6brD@ravel>
In-Reply-To: <0a04f310-af5c-371c-0940-1b0af0f5aca4@tundraware.com>
References:  <0a04f310-af5c-371c-0940-1b0af0f5aca4@tundraware.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5996718.nAnukg6brD>