bf_compact
Matthias Andree
matthias.andree at gmx.de
Sun May 15 14:59:44 CEST 2005
David Relson <relson at osagesoftware.com> writes:
> On Sat, 14 May 2005 22:57:11 +0100
> R Kimber wrote:
>
>> On Sat, 14 May 2005 20:18:54 +0200
>> Matthias Andree <matthias.andree at gmx.de> wrote:
>>
>> > > Yes. Thanks. I wasn't offended - just that I used it as advertised
>> > > and my wordlist and config files disappeared.
>> >
>> > If your *wordlist* disappeared, then that is a genuine bug that needs
>> > to be fixed - in that case, have my apologies for mis-reading your
>> > previous mail. Configuration files in .bogofilter? DB_CONFIG perhaps,
>> > we are copying that if present, but no other configuration files
>> > should be in that directory, no?
>>
>> /etc/bogofilter.cf suggests one can have:-
>> user_config_file=~/.bogofilter/config
>> which is what I had.
>
> Good point. bogofilter.cf definitely mentions putting the config file
> in ~/.bogofilter. One solution would be to add lines like the
> following to bf_compact:
>
> FILES=`ls $BOGOHOME/* | egrep -v "$BOGOHOME/(log.0|__db.|lockfile.)"`
> cp -p $FILES $TEMP
I'd think this is much too broad. We want to leave everything behind.
We could use bogofilter -QQ however and look for the user_config_file
and copy it if it's part of that directory.
To that extent, and generally to check if two *existing* directories (or
otherwise inodes) are identical, we can stat() them and compare st_dev
and st_ino. Unfortunately, there is no standard utility that provides
these two figures, while ls(1) can provide st_ino, the "file serial
number", I know no way to determine st_dev. We'll have to write our
own. st_ino and st_dev are mandatory per POSIX.
Such code in a separate utility does not require much code. I'm hacking
such a beast now.
--
Matthias Andree
More information about the Bogofilter
mailing list