Heh, well, someone is talking about clearing stale files ! :)

I want to discuss about this topic many times, but don't know which
mailing list is proper for it..

Here is my way to clean stale files, which requires lots space and
time, but IMHO it's very safe and requires no special tricks. (Okay
okay, brute force, anyways)

First of all, I'll installworld to another directory _2 times_. The
reason for 2 times is, some openssl/*.ph wouldn't be created in the
first installworld.

my buildchroot.sh :
#!/bin/sh
D=/home/nexus/chroot
mkdir $D
make installworld DESTDIR=$D
cd etc
make distribution DESTDIR=$D
cd ..
make installworld DESTDIR=$D

After the virgin world is done, I use another stupid script to generate
the diff bewteen the virgin one and the live one.

my staleclean.sh :
#!/bin/sh
# usr
cd /home/nexus/chroot/usr
find bin/ include/ libdata/ sbin/ games/ lib/ libexec/ share/ | sort >/tmp/new
cd /usr
find bin/ include/ libdata/ sbin/ games/ lib/ libexec/ share/ | sort >/tmp/old
diff -u /tmp/old /tmp/new | grep -e '^-' | sed -e 's/-//' >
/tmp/usr.delist
# bin, sbin
cd /home/nexus/chroot
find bin/ sbin/ | sort > /tmp/new
cd /
find bin/ sbin/ | sort > /tmp/old
diff -u /tmp/old /tmp/new | grep -e '^-' | sed -e 's/-//' >
/tmp/bin.delist

Okay, this is not perfect. Before piping these .dellist files to
xargs, some editing is needed.

BTW, there're really *many many* things keep changing in -CURRENT :-)
Each time I start to clear stale files, they're counted by hundreds.

On Tue, Jun 05, 2001 at 11:51:34AM -0700, Nick Sayer wrote:
> After installworlds I routinely do an ls -altr on "the usual suspects", 
> which for me include:
> 
> /bin, /sbin, /usr/bin, /usr/sbin, /usr/libexec and /usr/lib.
> 
> /usr/lib must be done carefully. If it matches (this is a regex) 
> lib\..*\.so\.[0-9]+ then you should move it into /usr/lib/compat rather 
> than delete it. Just deleting them will cause any programs in /usr/X11R6 
> or /usr/local that were linked against the old libraries to stop 
> working. /usr/libexec/ld.so* also sometimes appear to be out of date but 
> really aren't. One of them is the a.out ld.so and if you have 1.x compat 
> libraries loaded you will need to leave that file alone despite it 
> having a very old date.
> 
> Anything else that is older than the starting time of the last 'make 
> installworld' in these directories can probably be deleted.
> 
> For extra credit you can do this to /usr/share/man/man* as well. It also 
> may not be a bad idea to rm -f /usr/share/man/cat*/* to make doubly sure 
> that obsolete man pages don't show up.


-- 
Clive Lin (Tong-I Lin)\n =P [EMAIL PROTECTED] # Family, friends, private
affairs\n =F [EMAIL PROTECTED] # Chinese ports, documentation\n =O
[EMAIL PROTECTED] # Others\n =J.* # What do you think about the 'J' ?\n

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to