[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cruft -- find any leftover files on your system



On Sun, Apr 05, 1998 at 04:10:22PM -0400, Fabien Ninoles wrote:

[cruft -- see http://va.debian.org/~ajt/]

> > (and then goes ahead and just accepts everything in /dev, /etc, /usr/src,
> > and /var/www because I couldn't think of good ways to determine what
> > should be in them :( )
> There also lot's of stuff in /var/spool /var/cache and /var/log, not?

Doh. :)

The *other* thing it does which I neglected to mention before, is to filter
the filenames that are produced to make some things more sensible, and to 
state that some files are explained as long as others are.

In particular, it `canonicalizes' all filenames, which is the function of
the /usr/bin/canonical program. For example, if

] $ ls -l /mail
] lrwxrwxrwx 1 root  root   16 Dec 27 13:32 /mail -> /var/spool/mail/
] $ find /mail -follow 
] /mail
] /mail/root
] /mail/aj
] ...
] $ find /mail -follow | canonical
] /mail
] /var/spool/mail/root
] /var/spool/mail/aj
] ...

That is, that any symlinks in the dirname are expanded.

Having done this, it replaces every instance of something like:
	/var/spool/foo/bar/baz
with
	/var/spool/foo

and converts filenames like /usr/lib/python/python1.5/zmod.py[oc] to
/usr/lib/python/python1.5/zmod.py (that is, that compiled python files
are okay, as long as their source code was -- it's all handled in
{pre,post}{inst,rm}s quite happily).

> > I'd _really_ like some way of working out what stuff should be in /etc,
> > and what stuff shouldn't, but a number of the files in there are made
> > in postinsts and I couldn't come up with a nice way of dealing with that.
> What about a dpkg service who looks like that:
> dpkg --add-file [--package <package>] <files...>
> and can be call from post-inst?

Ideally I'd like to end up with something that doesn't require any changes
to packages, if possible. I'm half inclined to suggest that packages should
list all their configuration files as conffiles (rather than just the ones
that they include in the .deb), which would probably clean up most of /etc
really neatly, but I'd like to think about that for a little longer.

In any case, it would be entirely possible for a package (call it "deity", 
say) to include something akin to:
	#!/bin/sh
	cat <<EOF
	/etc/deity.conf
	EOF
in a file called /usr/lib/cruft/pkg_deity, at which point cruft would 
expect /etc/deity.conf even though it doesn't appear in the original .deb.

That's not a very nice way of doing things though, to my way of thinking.

Cheers,
aj

-- 
Anthony Towns <aj@humbug.org.au> <http://azure.humbug.org.au/~aj/>
I don't speak for anyone save myself. PGP encrypted mail preferred.

      ``It's not a vision, or a fear. It's just a thought.''

Attachment: pgp_7Fzs8YION.pgp
Description: PGP signature


Reply to: