ports/83906: [MAINTAINER] mail/bogofilter: update to 0.95.2

Matthias Andree matthias.andree at gmx.de
Fri Jul 22 13:11:20 UTC 2005


>Number:         83906
>Category:       ports
>Synopsis:       [MAINTAINER] mail/bogofilter: update to 0.95.2
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 22 13:10:18 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Matthias Andree
>Release:        FreeBSD 5.4-RELEASE-p3 i386
>Organization:
>Environment:
System: FreeBSD sigma.emma.line.org 5.4-RELEASE-p3 FreeBSD 5.4-RELEASE-p3 #10: Sat Jul  2 15:26:39 CEST
>Description:
- Update to 0.95.2

Added file(s):
- files/patch-aa
- files/patch-ab

Removed file(s):
- files/patch-src_bf__resize.in
- files/patch-src_datastore__db__trans.c
- files/patch-src_datastore__tdb.c

Generated with FreeBSD Port Tools 0.63
>How-To-Repeat:
>Fix:

--- bogofilter-0.95.2.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/mail/bogofilter/Makefile /usr/home/emma/ports/mail/bogofilter/Makefile
--- /usr/ports/mail/bogofilter/Makefile	Mon Jun 27 20:30:14 2005
+++ /usr/home/emma/ports/mail/bogofilter/Makefile	Fri Jul 22 13:18:23 2005
@@ -6,8 +6,8 @@
 #
 
 PORTNAME=	bogofilter
-PORTVERSION=	0.94.14
-PORTREVISION?=	1
+PORTVERSION=	0.95.2
+PORTREVISION?=	0
 CATEGORIES?=	mail
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	${PORTNAME}
@@ -15,9 +15,9 @@
 MAINTAINER?=	matthias.andree at gmx.de
 COMMENT=	Fast, teachable, learning spam detector
 
-OPTIONS=	BASH  "Install scripts that depend on the bash(1) shell" on
-OPTIONS+=	GSL   "Link with system-wide GSL dynamically (recommended)" on
-OPTIONS+=	ICONV "Normalize tokens to Unicode (EXPERIMENTAL)" off
+OPTIONS=	BASH    "Install scripts that depend on the bash(1) shell" on
+OPTIONS+=	GSL     "Link with system-wide GSL dynamically (recommended)" on
+OPTIONS+=	UNICODE "Normalize tokens to Unicode (UTF-8)" on
 
 LIB_DEPENDS?=	db-4.3:${PORTSDIR}/databases/db43
 
@@ -38,8 +38,8 @@
 BF_LIBS?=		-ldb-4.3
 BF_CPPFLAGS?=		-I${LOCALBASE}/include/db43 -I${LOCALBASE}/include
 CONFIGURE_ARGS+=	--sysconfdir=${PREFIX}/etc
-.if defined(WITH_ICONV)
-CONFIGURE_ARGS+=	--enable-iconv
+.if !defined(WITHOUT_UNICODE)
+CONFIGURE_ARGS+=	--enable-unicode
 USE_ICONV=		yes
 BF_LIBS+=		-liconv
 .endif
@@ -54,7 +54,7 @@
 INSTALL_TARGET=	install-strip prefix=${PREFIX}
 
 MAN1=		bogofilter.1 bogoutil.1 bogoupgrade.1 bogolexer.1 bogotune.1 \
-		bf_copy.1 bf_compact.1 bf_resize.1 bf_tar.1
+		bf_copy.1 bf_compact.1 bf_tar.1
 
 post-patch:
 	${REINPLACE_CMD} -e "s|/bin/bash|${LOCALBASE}/bin/bash|" \
@@ -67,6 +67,8 @@
 		${WRKSRC}/contrib/bogominitrain.pl \
 		${WRKSRC}/contrib/mime.get.rfc822 \
 		${WRKSRC}/contrib/printmaildir.pl
+	${REINPLACE_CMD} -e 's/INTEGRITY_TESTS = t.lock1 t.lock3 t.valgrind/INTEGRITY_TESTS = t.lock1 t.lock3/' \
+		${WRKSRC}/src/tests/Makefile.in
 
 .if !defined(NOPORTDOCS)
 PORTDOCS=	*
diff -ruN --exclude=CVS /usr/ports/mail/bogofilter/distinfo /usr/home/emma/ports/mail/bogofilter/distinfo
--- /usr/ports/mail/bogofilter/distinfo	Mon Jun 27 20:30:14 2005
+++ /usr/home/emma/ports/mail/bogofilter/distinfo	Fri Jul 22 13:09:32 2005
@@ -1,2 +1,2 @@
-MD5 (bogofilter-0.94.14.tar.bz2) = 59fa3eefc510458f786c893de271b819
-SIZE (bogofilter-0.94.14.tar.bz2) = 723279
+MD5 (bogofilter-0.95.2.tar.bz2) = 43da78d185f6a206923e6fb8e50c6fe7
+SIZE (bogofilter-0.95.2.tar.bz2) = 725106
diff -ruN --exclude=CVS /usr/ports/mail/bogofilter/files/patch-aa /usr/home/emma/ports/mail/bogofilter/files/patch-aa
--- /usr/ports/mail/bogofilter/files/patch-aa	Thu Jan  1 01:00:00 1970
+++ /usr/home/emma/ports/mail/bogofilter/files/patch-aa	Fri Jul 22 13:15:13 2005
@@ -0,0 +1,47 @@
+--- a/src/tests/t.encoding	30 Jun 2005 11:17:54 -0000	1.5
++++ b/src/tests/t.encoding	9 Jul 2005 22:24:12 -0000	1.8
+@@ -84,21 +84,34 @@
+ $BOGOUTIL -C -y 0 -m ${WORDLIST} --unicode=no
+ $BOGOUTIL -C -y 0 -d ${WORDLIST} | sort > ${TMPDIR}/wordlist.old.txt
+ 
+-cat <<EOF | sed "s/ $DATE//" > ${TMPDIR}/md5sum.ref
+-4ff193bff18e44bd6af0992497565df2 -   wordlist.iconv.txt
+-4ff193bff18e44bd6af0992497565df2 -   wordlist.new.txt
+-a36783e5753e6254167ffe32835e96d0 -   wordlist.no.txt
+-a36783e5753e6254167ffe32835e96d0 -   wordlist.old.txt
+-a36783e5753e6254167ffe32835e96d0 -   wordlist.raw.txt
+-4ff193bff18e44bd6af0992497565df2 -   wordlist.yes.txt
++echo "This is a test." >${TMPDIR}/empty.txt
++if ! cksum >${TMPDIR}/empty.sum ${TMPDIR}/empty.txt ; then
++    echo >&2 'cksum utility not found'
++    exit 77
++fi
++tr '	' ' ' <${TMPDIR}/empty.sum|cut -d " " -f 1-2 >${TMPDIR}/empty.sumonly
++if ! echo "2711662207 16" | cmp -s - ${TMPDIR}/empty.sumonly
++then
++    echo >&2 'cksum utility not POSIX compliant!'
++    exit 1
++fi
++
++cat <<EOF | sed "s/ $DATE//" > ${TMPDIR}/cksum.ref
++1059676362 909 wordlist.iconv.txt
++1059676362 909 wordlist.new.txt
++3303802408 880 wordlist.no.txt
++3303802408 880 wordlist.old.txt
++3303802408 880 wordlist.raw.txt
++1059676362 909 wordlist.yes.txt
+ EOF
+ 
+ for FILE in ${TMPDIR}/wordlist.*.txt ; do
+-    ( echo `md5sum < $FILE` " " `basename $FILE` ) >>  ${TMPDIR}/md5sum.out
++    cksum "$FILE" | $AWK '{ printf "%s %s ", $1, $2 }' >>${TMPDIR}/cksum.out
++    basename "$FILE" >>${TMPDIR}/cksum.out
+ done
+ 
+ if [ $verbose -eq 0 ] ; then 
+-    cmp ${TMPDIR}/md5sum.ref ${TMPDIR}/md5sum.out
++    cmp ${TMPDIR}/cksum.ref ${TMPDIR}/cksum.out
+ else
+-    diff ${TMPDIR}/md5sum.ref ${TMPDIR}/md5sum.out
++    diff -s ${TMPDIR}/cksum.ref ${TMPDIR}/cksum.out
+ fi
diff -ruN --exclude=CVS /usr/ports/mail/bogofilter/files/patch-ab /usr/home/emma/ports/mail/bogofilter/files/patch-ab
--- /usr/ports/mail/bogofilter/files/patch-ab	Thu Jan  1 01:00:00 1970
+++ /usr/home/emma/ports/mail/bogofilter/files/patch-ab	Fri Jul 22 13:27:14 2005
@@ -0,0 +1,154 @@
+--- a/src/charset.c	23 Jun 2005 22:39:55 -0000	1.32
++++ b/src/charset.c	4 Jul 2005 18:41:20 -0000	1.33
+@@ -25,7 +25,9 @@
+ 
+ #include "charset.h"
+ #include "convert_charset.h"
++#ifndef	DISABLE_UNICODE
+ #include "convert_unicode.h"
++#endif
+ #include "xmalloc.h"
+ #include "xstrdup.h"
+ 
+--- a/src/datastore_sqlite.c	21 May 2005 03:39:21 -0000	1.38
++++ b/src/datastore_sqlite.c	10 Jul 2005 00:21:03 -0000	1.40
+@@ -152,6 +152,16 @@
+     return rc;
+ }
+ 
++static sqlite3_stmt *sqlprep(dbh_t *dbh, const char *cmd) {
++    const char *tail; /* dummy */
++    sqlite3_stmt *ptr;
++    if (sqlite3_prepare(dbh->db, cmd, strlen(cmd), &ptr, &tail) != SQLITE_OK) {
++	print_error(__FILE__, __LINE__, "cannot compile %s: %s\n", cmd, sqlite3_errmsg(dbh->db)); 
++	exit(EX_ERROR); 
++    }
++    return ptr;
++}
++
+ /** Short trace handler function, passed to SQLite if debugging is
+  * enabled. */
+ static void db_trace(void *userdata /** unused */,
+@@ -236,6 +246,31 @@
+     return 1;
+ }
+ 
++static void check_sqlite_version(void)
++{
++#if SIZEOF_LONG > 4
++    unsigned int vmaj, vmin, vpl;
++    int count;
++    static int complained;
++    const char *v;
++
++    if (complained)
++	return;
++    complained = 1;
++    v = sqlite3_libversion();
++    sscanf(v, "%u.%u.%u", &vmaj, &vmin, &vpl);
++    if (vmaj > 3) return;
++    if (vmaj == 3 && vmin > 2) return;
++    if (vmaj == 3 && vmin == 2 && vpl >= 2) return;
++    fprintf(stderr,
++	    "\n"
++	    "WARNING: sqlite %s is not supported on %u-bit machines!\n"
++	    "WARNING: If you see bus errors, update sqlite to 3.2.2 or newer.\n"
++	    "\n",
++	    v, SIZEOF_LONG * 8);
++#endif
++}
++
+ void *db_open(void *dummyenv, bfpath *bfp, dbmode_t mode)
+ {
+     int rc;
+@@ -244,6 +279,8 @@
+ 
+     (void)dummyenv;
+ 
++    check_sqlite_version();
++
+     dbh = dbh_init(bfp);
+ 
+     /* open database file */
+@@ -320,16 +357,8 @@
+      * dbh->insert is not here as it's needed earlier,
+      * so it sets itself up lazily
+      */
+-#define PREP(cmd, ptr) \
+-    { const char *tail; /* dummy */ \
+-	if (sqlite3_prepare(dbh->db, cmd, strlen(cmd), ptr, &tail) != SQLITE_OK) { \
+-	    print_error(__FILE__, __LINE__, "cannot compile %s: %s\n", cmd, sqlite3_errmsg(dbh->db)); \
+-	    exit(EX_ERROR); \
+-	} \
+-    }
+-
+-    PREP("SELECT value FROM bogofilter WHERE key=? LIMIT 1;", &dbh->select);
+-    PREP("DELETE FROM bogofilter WHERE(key = ?);", &dbh->delete);
++    dbh->select = sqlprep(dbh, "SELECT value FROM bogofilter WHERE key=? LIMIT 1;");
++    dbh->delete = sqlprep(dbh, "DELETE FROM bogofilter WHERE(key = ?);");
+ 
+     /* check if byteswapped */
+     {
+@@ -398,7 +427,7 @@
+     static char buf[80];
+ 
+     if (!buf[0])
+-	snprintf(buf, sizeof(buf), "SQLite %s", sqlite3_version);
++	snprintf(buf, sizeof(buf), "SQLite %s", sqlite3_libversion());
+     return buf;
+ }
+ 
+@@ -426,8 +455,8 @@
+ 	dbh_t *dbh,		/**< database handle */
+ 	const char *func,	/**< function name to report in errors */
+ 	sqlite3_stmt *stmt,	/**< SQLite3 statement to execute/reset */
+-	int retnotfound,	/**< return value if no rows found */
+-	dbv_t *val		/**  OUT value from first row, NULL ok */
++	dbv_t *val,		/**< OUT value from first row, NULL ok */
++	int retnotfound		/**  return value if no rows found */
+ 	)
+ {
+     int rc;
+@@ -468,25 +497,25 @@
+     dbh_t *dbh = vhandle;
+ 
+     sqlite3_bind_blob(dbh->delete, 1, key->data, key->leng, SQLITE_STATIC);
+-    return sql_fastpath(dbh, "db_delete", dbh->delete, 0, NULL);
++    return sql_fastpath(dbh, "db_delete", dbh->delete, NULL, 0);
+ }
+ 
+ int db_set_dbvalue(void *vhandle, const dbv_t *key, const dbv_t *val) {
+     dbh_t *dbh = vhandle;
+ 
+     if (!dbh->insert)
+-	PREP("INSERT OR REPLACE INTO bogofilter VALUES(?,?);",    &dbh->insert);
++	dbh->insert = sqlprep(dbh, "INSERT OR REPLACE INTO bogofilter VALUES(?,?);");
+ 
+     sqlite3_bind_blob(dbh->insert, 1, key->data, key->leng, SQLITE_STATIC);
+     sqlite3_bind_blob(dbh->insert, 2, val->data, val->leng, SQLITE_STATIC);
+-    return sql_fastpath(dbh, "db_set_dbvalue", dbh->insert, 0, NULL);
++    return sql_fastpath(dbh, "db_set_dbvalue", dbh->insert, NULL, 0);
+ }
+ 
+ int db_get_dbvalue(void *vhandle, const dbv_t* key, /*@out@*/ dbv_t *val) {
+     dbh_t *dbh = vhandle;
+ 
+     sqlite3_bind_blob(dbh->select, 1, key->data, key->leng, SQLITE_STATIC);
+-    return sql_fastpath(dbh, "db_get_dbvalue", dbh->select, DS_NOTFOUND, val);
++    return sql_fastpath(dbh, "db_get_dbvalue", dbh->select, val, DS_NOTFOUND);
+ }
+ 
+ ex_t db_foreach(void *vhandle, db_foreach_t hook, void *userdata) {
+--- a/src/maint.c	25 Jun 2005 16:42:44 -0000	1.64
++++ b/src/maint.c	4 Jul 2005 18:41:20 -0000	1.65
+@@ -19,8 +19,10 @@
+ #include "datastore.h"
+ #include "error.h"
+ #include "charset.h"
++#ifndef	DISABLE_UNICODE
+ #include "convert_unicode.h"
+ #include "iconvert.h"
++#endif
+ #include "maint.h"
+ #include "transaction.h"
+ #include "wordlists.h"
diff -ruN --exclude=CVS /usr/ports/mail/bogofilter/files/patch-src_bf__resize.in /usr/home/emma/ports/mail/bogofilter/files/patch-src_bf__resize.in
--- /usr/ports/mail/bogofilter/files/patch-src_bf__resize.in	Tue Jun 21 16:44:17 2005
+++ /usr/home/emma/ports/mail/bogofilter/files/patch-src_bf__resize.in	Thu Jan  1 01:00:00 1970
@@ -1,29 +0,0 @@
---- a/src/bf_resize.in Mon Jun 13 21:56:45 2005
-+++ b/src/bf_resize.in Mon Jun 20 13:50:17 2005
-@@ -35,19 +35,19 @@
- # count pages in database files
- for DB in $DATABASES ; do
-     COUNT=`bogoutil --db-print-leafpage-count="$DB"`
--    let PAGES="$PAGES + $COUNT"
-+    PAGES=$(( $PAGES + $COUNT ))
- done
- 
- # be generous, double count
--let PAGES="$PAGES + $PAGES"
-+PAGES=$(( $PAGES + $PAGES ))
- 
- # and update or create DB_CONFIG
- : >> "$BOGOHOME"/DB_CONFIG
--(
--  set +e
--  egrep -v '^set_lk_max_(locks|objects)' "$BOGOHOME"/DB_CONFIG >"$BOGOHOME"/DB_CONFIG.new
--)
--if [ $? -ge 2 ] ; then exit 1 ; fi
-+set +e
-+egrep -v '^set_lk_max_(locks|objects)' "$BOGOHOME"/DB_CONFIG >"$BOGOHOME"/DB_CONFIG.new
-+s=$?
-+set -e
-+if [ $s -ge 2 ] ; then exit 1 ; fi
- echo >>"$BOGOHOME"/DB_CONFIG.new set_lk_max_locks $PAGES
- echo >>"$BOGOHOME"/DB_CONFIG.new set_lk_max_objects $PAGES
- mv "$BOGOHOME"/DB_CONFIG.new "$BOGOHOME"/DB_CONFIG
diff -ruN --exclude=CVS /usr/ports/mail/bogofilter/files/patch-src_datastore__db__trans.c /usr/home/emma/ports/mail/bogofilter/files/patch-src_datastore__db__trans.c
--- /usr/ports/mail/bogofilter/files/patch-src_datastore__db__trans.c	Tue Jun 14 15:13:50 2005
+++ /usr/home/emma/ports/mail/bogofilter/files/patch-src_datastore__db__trans.c	Thu Jan  1 01:00:00 1970
@@ -1,14 +0,0 @@
---- a/src/datastore_db_trans.c	8 Jun 2005 12:18:59 -0000	1.31.4.1
-+++ b/src/datastore_db_trans.c	9 Jun 2005 07:54:35 -0000	1.31.4.2
-@@ -943,8 +943,10 @@
- #else
-     r = ENOENT;
- #endif
--    if (r == DB_RUNRECOVERY)
-+    if (r == DB_RUNRECOVERY) {
-+	dbe->close(dbe, 0);
- 	return T_ENABLED;
-+    }
- 
-     if (r == ENOENT) {
- 	struct stat st;
diff -ruN --exclude=CVS /usr/ports/mail/bogofilter/files/patch-src_datastore__tdb.c /usr/home/emma/ports/mail/bogofilter/files/patch-src_datastore__tdb.c
--- /usr/ports/mail/bogofilter/files/patch-src_datastore__tdb.c	Tue Jun 14 15:13:50 2005
+++ /usr/home/emma/ports/mail/bogofilter/files/patch-src_datastore__tdb.c	Thu Jan  1 01:00:00 1970
@@ -1,42 +0,0 @@
---- a/src/datastore_tdb.c	31 May 2005 15:04:05 -0000	1.51.22.1
-+++ b/src/datastore_tdb.c	10 Jun 2005 08:19:30 -0000	1.51.22.2
-@@ -268,20 +268,34 @@
-     dbv_t dbv_key, dbv_data;
-     userdata_t *hookdata = userdata;
- 
--    /* Question: Is there a way to avoid using malloc/free? */
--
--    /* switch to "dbv_t *" variables */
-+    /* TDB happily returns data from odd addresses, so we need to
-+     * memcpy() everything to properly aligned storage (malloc() is
-+     * fine) if our callee wishes to perform word-sized access - without
-+     * memcpy(), the callee will die with SIGBUS (SPARC, m68k) or get
-+     * extremely slow (i386). */
-+
-+    /* XXX FIXME: Possible optimization if this function is only used by
-+     * one caller at a time (i. e. no threads): allocate buffers
-+     * statically and reuse them as long as they are of sufficient size
-+     * and reallocate otherwise. */
-+
-+    /* copy key */
-+    /* XXX FIXME: do we really need to use C-string compatible keys?
-+     * Looks wasteful. */
-     dbv_key.leng = key.dsize;
-     dbv_key.data = xmalloc(dbv_key.leng+1);
-     memcpy(dbv_key.data, key.dptr, dbv_key.leng);
-     ((char *)dbv_key.data)[dbv_key.leng] = '\0';
- 
--    dbv_data.data = data.dptr;
--    dbv_data.leng = data.dsize;		/* read count */
-+    /* copy data */
-+    dbv_data.leng = data.dsize;
-+    dbv_data.data = xmalloc(dbv_data.leng);
-+    memcpy(dbv_data.data, data.dptr, dbv_data.leng);
- 
-     /* call user function */
-     rc = hookdata->hook(&dbv_key, &dbv_data, hookdata->userdata);
- 
-+    xfree(dbv_data.data);
-     xfree(dbv_key.data);
- 
-     return rc;
diff -ruN --exclude=CVS /usr/ports/mail/bogofilter/pkg-plist /usr/home/emma/ports/mail/bogofilter/pkg-plist
--- /usr/ports/mail/bogofilter/pkg-plist	Thu Jun  2 15:55:46 2005
+++ /usr/home/emma/ports/mail/bogofilter/pkg-plist	Fri Jul 22 13:11:13 2005
@@ -1,6 +1,5 @@
 bin/bf_compact
 bin/bf_copy
-bin/bf_resize
 bin/bf_tar
 bin/bogofilter
 bin/bogolexer
--- bogofilter-0.95.2.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list