mounty1 wrote:tools such as eclean-dist are imperfect in my situation since my local repository is shared (NFS-mounted) amongst several machines, and none is the source-of-truth of what packages are required, obsolete etc.
Closest to your find -command equivalent can be achieved by passing
-t or
--time-limit=<time> for
eclean-dist.
Although carefully crafting a find -command can achieve almost same results.
For example:
Code: Select all
find "$(portageq envvar DISTDIR)" -maxdepth 1 -mindepth 1 -type f -atime +180 -delete
... would delete distfiles which haven't been accessed in about half a year.
That would take NFS accessed files into account. Unless your filesystem doesn't support access times or you have mounted the filesystem with
noatime. This, however, can't take installed packages into account. So, not perfect either. Also access time can be updated by others than just portage doing an install.
One other way, you could create a list of distfiles each client thinks it doesn't need by running:
Code: Select all
eclean-dist --quiet --pretend | sed 's|^/.*/||'
... but that "will escalate very quickly" into a complex coding project. You'd need to make comparisons and determine that if each client thinks the file is now useless, then remove it.
It's a simple problem for one client, but if multiple are accessing then same $DISTDIR via network it gets complicated really quick.
@
wjb: What's your implementation, roughly?