[gentoo-user] Re: Cleaning out my world file

2008-08-17 Thread Francesco Talamona
On Sunday 17 August 2008, Albert Hopkins wrote:
> On Sun, 2008-08-17 at 08:00 +0200, Francesco Talamona wrote:
> > It doesn't handle filenames with spaces, I tried with
> >
> > find /etc -xdev -type f -exec qfile -o {} \;
> >
> > that works with spaces, but has awful performances, so that's
> > completely
> > unusable on /usr.
> >
> > BTW I also tried to remove false positive hiding /usr/portage and
> > the overlays folder .
> >
> > Does anyone know how to deal with spaces (to avoid false positives)
> > and
> > keep reasonable running times?
>
> Change "-print" to "-print0" and change "xargs" to "xargs -0".
>
> I should also say that that script is not fool-proof.  It goes under
> the assumption that files are always going to be installed by the
> ebuild src_install process.  Experience shows this is not always the
> case.  For example the *.pyc files, some, /etc/*, font-cache files,
> etc. are installed during post-install and so are not "recorded" by
> portage as belonging to a package.  Common sense always prevails.  Of
> course a person cleaning out an /etc/ dir that you hasn't been
> cleaned out in five years is going to require considerably more
> "common sense" than one who cleaned theirs out last month.
>
> I've also modified the script to exclude /usr/portage and /usr/local
> (they were on separate filesystems for me so I didn't need to).  You
> may need to tweak it further for your needs.
>
> -a

It works very well. It's perfect for the purpose.
I already found many leftover here and there.

As you say the script gives clues, but obviously it can't be automated.

Thanks
FT  

-- 
Linux Version 2.6.26-gentoo, Compiled #2 PREEMPT Sat Aug 9 20:21:11 CEST 
2008
One 1GHz AMD Athlon 64 Processor, 2GB RAM, 2004.04 Bogomips Total
aemaeth



Re: [gentoo-user] Re: Cleaning out my world file

2008-08-17 Thread Albert Hopkins
On Sun, 2008-08-17 at 08:00 +0200, Francesco Talamona wrote:
> It doesn't handle filenames with spaces, I tried with 
> 
> find /etc -xdev -type f -exec qfile -o {} \;
> 
> that works with spaces, but has awful performances, so that's
> completely 
> unusable on /usr.
> 
> BTW I also tried to remove false positive hiding /usr/portage and the 
> overlays folder .
> 
> Does anyone know how to deal with spaces (to avoid false positives)
> and 
> keep reasonable running times?

Change "-print" to "-print0" and change "xargs" to "xargs -0".

I should also say that that script is not fool-proof.  It goes under the
assumption that files are always going to be installed by the ebuild
src_install process.  Experience shows this is not always the case.  For
example the *.pyc files, some, /etc/*, font-cache files, etc. are
installed during post-install and so are not "recorded" by portage as
belonging to a package.  Common sense always prevails.  Of course a
person cleaning out an /etc/ dir that you hasn't been cleaned out in
five years is going to require considerably more "common sense" than one
who cleaned theirs out last month.

I've also modified the script to exclude /usr/portage and /usr/local
(they were on separate filesystems for me so I didn't need to).  You may
need to tweak it further for your needs.

-a


orphans.sh
Description: application/shellscript


[gentoo-user] Re: Cleaning out my world file

2008-08-16 Thread Francesco Talamona
On Friday 15 August 2008, Albert Hopkins wrote:
> On Fri, 2008-08-15 at 08:38 -0500, Dale wrote:
> > Alan McKinnon wrote:
> > > On Friday 15 August 2008 14:36:58 Dale wrote:
> > >> Somewhat still on the same subject since I am still cleaning. 
> > >> Anyway to clean out unneeded files in /etc?  I'm thinking about
> > >> files that may be there but the programs are no longer
> > >> installed.  I read the man page for dep but didn't see anything.
> > >>  Dang thing does a lot tho.
> > >
> > > You could use the very long way round, something based on this:
> > >
> > > find /etc/ -type f -exec equery belongs {} \;
> > >
> > > then leave it alone for an hour or three
> >
> > H, I had to stop that after a few minutes.  It sort of took
> > away from my folding.  Pushed my CPU to about 80% or so.
> >
> > There has to be a tool for this too.  Gentoo has about everything
> > else.
>
> I do a similar thing every month as a cron job.  It' runs at night so
> I just get an email the next day.
>
> --
> #!/bin/bash
>
> # Print out orphan files in specified directories
>
> find /etc -xdev -type f -print|xargs qfile -o
> find /usr -xdev \( -path /usr/src -prune \) -o -type f -not -name
> '*.pyc' \
> -not -name '*.pyo' -not -name .keep  -print | \
> xargs qfile -o
> find /lib -xdev \( -path /lib/modules -prune \) -o -type f |xargs
> qfile -o

It doesn't handle filenames with spaces, I tried with 

find /etc -xdev -type f -exec qfile -o {} \;

that works with spaces, but has awful performances, so that's completely 
unusable on /usr.

BTW I also tried to remove false positive hiding /usr/portage and the 
overlays folder .

Does anyone know how to deal with spaces (to avoid false positives) and 
keep reasonable running times?

TIA
Francesco

-- 
Linux Version 2.6.26-gentoo, Compiled #2 PREEMPT Sat Aug 9 20:21:11 CEST 
2008
One 1GHz AMD Athlon 64 Processor, 2GB RAM, 2004.04 Bogomips Total
aemaeth