Re: Stale pieces in the base system? (was: hardcoded -C argument to ${INSTALL})

From: Doug Barton <DougB_at_FreeBSD.org>
Date: Tue, 6 May 2003 21:36:30 -0700 (PDT)
On Tue, 6 May 2003, Garance A Drosihn wrote:

> My fear is that any attempt to do the "perverse and powerful"
> solution will open too many cans of worms, and will never
> actually get done.  There have been many "obvious" solutions
> posted to solve the problem of stale files, including some
> grand claims that I have made from time-to-time, but the
> problem turns a bit tricky when one tries to actually
> implement something that will work for all freebsd users.

With all due respect guys, this is a big part of why it hasn't been done
yet. You're defining the problem space too big. What you want to start
with is something that will work for MOST users, with big fat warnings for
eveyrone else. Then refine it as you go. That's the model I used with
mergemaster, and it's worked pretty well so far. :)

To get the ball rolling, here is the little function I use for
installworld:

doinstall ()
{
    cd /usr && [ -d include-old ] && rm -r include-old;
    [ ! -e include-old ] && mv -i include include-old;
    rm -r /usr/share/man;
    cd /usr/src && make installworld
}

That covers a great deal of sin right there. Then if I really want to
scrub an installation, I do a series of 'cd <dir> && ls -lt' to see if
there is anything in there that wasn't built and installed today.
Depending on what it is, I either save it in an 0ld directory (I use zero
because it usually sorts first), or delete it outright. libs I usually
save, just in case. It's pretty easy to do /bin, /sbin, /usr/bin,
/usr/sbin, /usr/games, and /usr/lib this way. /usr/libexec is mostly
doable this way, /usr/libdata is a little tougher.

It wouldn't be hard to add something to the installworld target that
touches a file somewhere convenient, then you could easily do something
like:

for dir in <list>; do
	for file in `find $dir ( -type f -o -type l ) -a \
		! -newer <file>`; do
		<prompt user to deal with file>
	done
done

This is totally untested, but it would get you pretty far in the right
direction.

Seriously.... this doesn't have to be an ultimate solution on the first
day. Trying to do that dooms the project to failure before it starts. The
most important thing to keep in mind is that this process is REALLY
dangerous. It would have to have a lot of "special knowledge" about
certain files. /sbin/init.bak for example...  It wouldn't be easy, and it
would definitely be an "expert users only" option, but it would be doable.

Hope this helps,

Doug

-- 

    This .signature sanitized for your protection
Received on Tue May 06 2003 - 19:36:33 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:06 UTC