Bug#501947: /usr/bin/bf_compact-sqlite: tries to use wrong version of bogofilter/bogoutil
Clint Adams
schizo at debian.org
Thu Oct 16 01:18:18 CEST 2008
On Thu, Oct 16, 2008 at 12:47:54AM +0200, Matthias Andree wrote:
> Do we need like patches for other scripts and/or docs?
Yes, bf_tar and bf_compact, at least. They're calling the untransformed
name directly (which on Debian is the BDB version).
The usage output should also probably use a transform or $0, but I won't
bother.
Index: src/bf_tar.in
===================================================================
--- src/bf_tar.in (revision 6746)
+++ src/bf_tar.in (working copy)
@@ -11,6 +11,9 @@
set -e
+: ${BOGOFILTER:=@transformed_bogofilter@}
+: ${BOGOUTIL:=@transformed_bogoutil@}
+
REMOVEBEF=0
REMOVEAFT=0
while [ "$1" ] ; do
@@ -43,14 +46,14 @@
fi
nukelogs() {
- bogoutil --db-prune="$BOGOHOME"
+ $BOGOUTIL --db-prune="$BOGOHOME"
}
# remove if requested
if [ $REMOVEBEF -eq 1 ] ; then
nukelogs
else
- bogoutil --db-checkpoint="$BOGOHOME"
+ $BOGOUTIL --db-checkpoint="$BOGOHOME"
fi
# database first, then the logs.
@@ -61,8 +64,8 @@
(
c="${BOGOHOME}/DB_CONFIG"
if [ -f "$c" ] ; then echo "$c" ; fi
- bogofilter -QQ -d "$BOGOHOME" | grep '^wordlist ' | cut -f3 -d,
- bogoutil --db-list-logfiles="$BOGOHOME" all
+ $BOGOFILTER -QQ -d "$BOGOHOME" | grep '^wordlist ' | cut -f3 -d,
+ $BOGOUTIL --db-list-logfiles="$BOGOHOME" all
) | pax -w -v -x ustar
# remove if requested
Index: src/bf_copy.in
===================================================================
--- src/bf_copy.in (revision 6746)
+++ src/bf_copy.in (working copy)
@@ -9,6 +9,8 @@
set -e # die on errors
+: ${BOGOUTIL:=@transformed_bogoutil@}
+
COMPACT=0
while test "$1" ; do
case "$1" in
@@ -30,7 +32,7 @@
DST="$2"
# flush mempools
-bogoutil --db-checkpoint="$SRC" || :
+$BOGOUTIL --db-checkpoint="$SRC" || :
mkdir "$DST"
@@ -39,7 +41,7 @@
trap "rm -rf $TMP \"$DST\"" 0
if test $COMPACT -eq 1 ; then
# don't copy unneeded logs
- bogoutil --db-list-logfiles="$SRC" >$TMP
+ $BOGOUTIL --db-list-logfiles="$SRC" >$TMP
else
: >$TMP
fi
@@ -50,10 +52,10 @@
if test -f "$SRC"/DB_CONFIG ; then cp -p "$SRC"/DB_CONFIG "$DST" ; fi
for FILE in "$SRC"/*.db ; do
- SIZE=`bogoutil --db-print-pagesize="$FILE"`
+ SIZE=`$BOGOUTIL --db-print-pagesize="$FILE"`
dd bs=$SIZE if=$FILE of="$DST/"`basename "$FILE"`
done
-if test "$LOGS" ; then bogoutil --db-recover="$DST" ; fi
+if test "$LOGS" ; then $BOGOUTIL --db-recover="$DST" ; fi
rm -f $TMP
trap - 0
More information about the bogofilter-dev
mailing list