bf_compact ruined my wordlist.db

David Relson relson at osagesoftware.com
Sat Jan 5 21:32:34 CET 2008


On Sat, 05 Jan 2008 12:23:09 +0200
Hussam Al-Tayeb wrote:

...[snip]...

> I know how to reproduce this. cd to you home  ( not to the .bogofilter
> folder)
> 
> 1. cd ~      ## This takes you to your home dir.
> 2. bf_compact ~/.bogofilter/ wordlist.db    ## yes, I know this isn't
> the correct syntax.
> 
> The old intact database is still in "~/.bogofilter.old" but
> "~/.bogofilter" now contains an empty database.

Hussam,

Thank you for your tip on reproducing problem.  Using your method and
my "-x" on the #! line, produced the following interesting output:

 + for FILE in '$FILES'
 ++ basename wordlist.db
 + NAME=wordlist.db
 + bogoutil -d wordlist.db
 + bogoutil --db-transaction=no -l bf_compact.13637/wordlist.db
 Can't open wordlist './wordlist.db'

As can be seen, the "bogoutil -d wordlist.db" command lacks a directory
name. It should read "bogoutil -d ~/.bogofilter/wordlist.db".

Here's the patch for bf_compact:

----- begin patch -----
--- bf_compact.old	2008-01-05 15:19:20.000000000 -0500
+++ bf_compact	2008-01-05 15:17:44.000000000 -0500
@@ -66,7 +66,7 @@
 # reload files
 for FILE in $FILES ; do
     NAME=`basename $FILE`
-    bogoutil -d $FILE | bogoutil --db-transaction=no -l $BOGOTEMP/$NAME
+    bogoutil -d $BOGOHOME/$FILE | bogoutil --db-transaction=no -l
$BOGOTEMP/$NAME done
 
 if [ $TXN = "yes" ] ; then
----- end patch -----

I've also attached a fixed copy of bf_compact.




More information about the Bogofilter mailing list