Package: cruft
Version: 0.9.6-0.4
Severity: important

1.Outline

There seems to be a design flaw in cruft's filter mechanism.  In some
ways this is a 'wishlist' bug, but I've tagged it 'important' because

- cruft's filters cause it to overlook cruft that it could and should find;
- with the current design, as cruft's filters improve so the problem worsens.

The good news is that the flaw is not hard to fix.  I'm providing what
I think is an almost complete solution.


2.The problem

Consider this common situation:  package 'foo' (1) contains an extra
file '/foo/bar' that dpkg wouldn't normally know about, and (2)
forgets to delete /foo/bar when foo is purged.

Alice installs package 'foo'.  She wants cruft to ship with a filter
/usr/lib/cruft/filters/foo so that /foo/bar is not reported as
'unexplained'.

But Bob also installs 'foo', and later he purges it.  He doesn't want
cruft to use the filter  /usr/lib/cruft/filters/foo.

[A real-life example: purging package 'inewsinn' leaves crufty files
like '/etc/news/whoami'.  Cruft is unable to report them because of
the filter named 'inn' - even if package 'inn' was never installed.]

Moreover, as cruft's filters improve with each new release (giving
fewer false positives) so cruft's ability to detect when these files
become crufty diminishes (giving more false negatives, so to speak).
The more you please Alice, the less you please Bob. It's a zero-sum
game!


3.A solution

I believe there is a good solution: cruft should use *all* of the
locally provided filters /etc/cruft/filters, but only *some* of the
filters shipped with cruft.

It should use filter /usr/lib/cruft/filters/<foo> if and only if
package <foo> seems to be installed on the system.

This can be done by modifying the script /usr/lib/cruft/extrafiles,
see attachment.

For this to be a complete solution, something needs to be done about
the filters not named after a package.  I believe they should be
abolished.  For example:

file               current filter name         proposed filter name
/etc/localtime     timezones                   libc6
/var/log/lastlog   lastlog                     login

This is better, eg it is libc6.postinst which creates /etc/localtime.


-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.4.27-2-686
Locale: LANG=en_GB, LC_CTYPE=en_GB (charmap=ISO-8859-1)

Versions of packages cruft depends on:
ii  file                        4.12-1       Determines file type using "magic"
ii  libc6                       2.3.2.ds1-22 GNU C Library: Shared libraries an

-- debconf-show failed

Attachment: extrafiles
Description: application/shellscript

Reply via email to