On Fri, 2010-03-19 at 23:28 +0300, Dmitry Bashkatov wrote:
> 2010/3/19 Brian Dolbec <brian.dolbec@gmail.com>:
> >>Dmitry Bashkatov
> >>
> >>Yes, I have already wrote a script. But it will be better to include
> >>this functionality to eclean.
> >
> > I am just completing a modular re-write of eclean.  It will be included
> > in the new gentoolkit-0.3.0_rc10 release coming out any time now.
> >
> > There is now a place in the code that will accept external functions for
> > additional checks to determine if the file is to be cleaned or not.  The
> > only thing missing is a possible configure/command line option to pass
> > them in for the search.
> >
> > I would be interested in your script to see how it may fit with the new
> > eclean.
> > --
> > Brian Dolbec <brian.dolbec@gmail.com>
> >
> 
> Here it is! File /etc/enetclean.hosts must contain all hosts, which
> share distfiles. Format is <host> or <user>@<host>. Script doesn't
> delete anything. It just prints out files that can be deleted. To
> delete use "enetclean | xargs rm -f".
> There is unhandled situation when distfiles located in another
> location than default /usr/portage/distfiles. Also it doesn't handle
> any errors such as failed connection. But anyway I think this script
> will be completely rewritten.
> 

Dmitry,  eclean is written in python same as portage.  For it to
integrate into eclean it too would also need to be written in python.
Unfortunately your script would not fit. 

There are 2 pieces of information that would be required from the client
pc's  the installed pkg list and the exclude file.  The exclude file
being a debatable one.  Since portage now needs a min. of python-2.6 it
should be possible for the network eclean module to import portage from
the client machine and obtain the installed pkg list.  From there it
would be added to a global installed pkgs list that would then remove
any source files they claim to own.  I think all other info and checks
would be handled by the eclean app running on the server.

As for the exclude file it may need to be transferred and parsed to
accumulate the results (trickier, due to possible conflicts).
alternatively that control might be better left controlled only on the
server. 

 Eclean would not need to installed on the client machines at all.

P.S.  eclean assumes all files dirty and in need of cleaning unless
proven otherwise (due to the dynamic nature of the tree). 
-- 
Brian Dolbec <brian.dolbec@gmail.com>