View | Details | Raw Unified | Return to bug 85421 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/home/emma/ports/mail/bogofilter/Makefile (-2 / +2 lines)
Lines 6-12 Link Here
6
#
6
#
7
7
8
PORTNAME=	bogofilter
8
PORTNAME=	bogofilter
9
PORTVERSION=	0.95.2
9
PORTVERSION=	0.96.0
10
PORTREVISION?=	0
10
PORTREVISION?=	0
11
CATEGORIES?=	mail
11
CATEGORIES?=	mail
12
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
12
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
Lines 88-94 Link Here
88
	RELEASE.NOTES doc/README.db doc/README.sqlite \
88
	RELEASE.NOTES doc/README.db doc/README.sqlite \
89
	doc/integrating-with-postfix doc/integrating-with-qmail \
89
	doc/integrating-with-postfix doc/integrating-with-qmail \
90
	doc/bogofilter-tuning.HOWTO.html doc/bogofilter-SA-2002-01 \
90
	doc/bogofilter-tuning.HOWTO.html doc/bogofilter-SA-2002-01 \
91
	doc/README.tdb doc/bogofilter-SA-2004-01 GETTING.STARTED \
91
	doc/bogofilter-SA-2004-01 GETTING.STARTED \
92
	doc/bogofilter-faq.html doc/bogofilter-faq-fr.html
92
	doc/bogofilter-faq.html doc/bogofilter-faq-fr.html
93
	  ${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
93
	  ${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
94
.endfor
94
.endfor
(-)/usr/home/emma/ports/mail/bogofilter/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
MD5 (bogofilter-0.95.2.tar.bz2) = 43da78d185f6a206923e6fb8e50c6fe7
1
MD5 (bogofilter-0.96.0.tar.bz2) = ca946b43212d8a2909e86f7140e535db
2
SIZE (bogofilter-0.95.2.tar.bz2) = 725106
2
SIZE (bogofilter-0.96.0.tar.bz2) = 721819
(-)/usr/home/emma/ports/mail/bogofilter/files/patch-aa (-47 lines)
Lines 1-47 Link Here
1
--- a/src/tests/t.encoding	30 Jun 2005 11:17:54 -0000	1.5
2
+++ b/src/tests/t.encoding	9 Jul 2005 22:24:12 -0000	1.8
3
@@ -84,21 +84,34 @@
4
 $BOGOUTIL -C -y 0 -m ${WORDLIST} --unicode=no
5
 $BOGOUTIL -C -y 0 -d ${WORDLIST} | sort > ${TMPDIR}/wordlist.old.txt
6
 
7
-cat <<EOF | sed "s/ $DATE//" > ${TMPDIR}/md5sum.ref
8
-4ff193bff18e44bd6af0992497565df2 -   wordlist.iconv.txt
9
-4ff193bff18e44bd6af0992497565df2 -   wordlist.new.txt
10
-a36783e5753e6254167ffe32835e96d0 -   wordlist.no.txt
11
-a36783e5753e6254167ffe32835e96d0 -   wordlist.old.txt
12
-a36783e5753e6254167ffe32835e96d0 -   wordlist.raw.txt
13
-4ff193bff18e44bd6af0992497565df2 -   wordlist.yes.txt
14
+echo "This is a test." >${TMPDIR}/empty.txt
15
+if ! cksum >${TMPDIR}/empty.sum ${TMPDIR}/empty.txt ; then
16
+    echo >&2 'cksum utility not found'
17
+    exit 77
18
+fi
19
+tr '	' ' ' <${TMPDIR}/empty.sum|cut -d " " -f 1-2 >${TMPDIR}/empty.sumonly
20
+if ! echo "2711662207 16" | cmp -s - ${TMPDIR}/empty.sumonly
21
+then
22
+    echo >&2 'cksum utility not POSIX compliant!'
23
+    exit 1
24
+fi
25
+
26
+cat <<EOF | sed "s/ $DATE//" > ${TMPDIR}/cksum.ref
27
+1059676362 909 wordlist.iconv.txt
28
+1059676362 909 wordlist.new.txt
29
+3303802408 880 wordlist.no.txt
30
+3303802408 880 wordlist.old.txt
31
+3303802408 880 wordlist.raw.txt
32
+1059676362 909 wordlist.yes.txt
33
 EOF
34
 
35
 for FILE in ${TMPDIR}/wordlist.*.txt ; do
36
-    ( echo `md5sum < $FILE` " " `basename $FILE` ) >>  ${TMPDIR}/md5sum.out
37
+    cksum "$FILE" | $AWK '{ printf "%s %s ", $1, $2 }' >>${TMPDIR}/cksum.out
38
+    basename "$FILE" >>${TMPDIR}/cksum.out
39
 done
40
 
41
 if [ $verbose -eq 0 ] ; then 
42
-    cmp ${TMPDIR}/md5sum.ref ${TMPDIR}/md5sum.out
43
+    cmp ${TMPDIR}/cksum.ref ${TMPDIR}/cksum.out
44
 else
45
-    diff ${TMPDIR}/md5sum.ref ${TMPDIR}/md5sum.out
46
+    diff -s ${TMPDIR}/cksum.ref ${TMPDIR}/cksum.out
47
 fi
(-)/usr/home/emma/ports/mail/bogofilter/files/patch-ab (-154 lines)
Lines 1-154 Link Here
1
--- a/src/charset.c	23 Jun 2005 22:39:55 -0000	1.32
2
+++ b/src/charset.c	4 Jul 2005 18:41:20 -0000	1.33
3
@@ -25,7 +25,9 @@
4
 
5
 #include "charset.h"
6
 #include "convert_charset.h"
7
+#ifndef	DISABLE_UNICODE
8
 #include "convert_unicode.h"
9
+#endif
10
 #include "xmalloc.h"
11
 #include "xstrdup.h"
12
 
13
--- a/src/datastore_sqlite.c	21 May 2005 03:39:21 -0000	1.38
14
+++ b/src/datastore_sqlite.c	10 Jul 2005 00:21:03 -0000	1.40
15
@@ -152,6 +152,16 @@
16
     return rc;
17
 }
18
 
19
+static sqlite3_stmt *sqlprep(dbh_t *dbh, const char *cmd) {
20
+    const char *tail; /* dummy */
21
+    sqlite3_stmt *ptr;
22
+    if (sqlite3_prepare(dbh->db, cmd, strlen(cmd), &ptr, &tail) != SQLITE_OK) {
23
+	print_error(__FILE__, __LINE__, "cannot compile %s: %s\n", cmd, sqlite3_errmsg(dbh->db)); 
24
+	exit(EX_ERROR); 
25
+    }
26
+    return ptr;
27
+}
28
+
29
 /** Short trace handler function, passed to SQLite if debugging is
30
  * enabled. */
31
 static void db_trace(void *userdata /** unused */,
32
@@ -236,6 +246,31 @@
33
     return 1;
34
 }
35
 
36
+static void check_sqlite_version(void)
37
+{
38
+#if SIZEOF_LONG > 4
39
+    unsigned int vmaj, vmin, vpl;
40
+    int count;
41
+    static int complained;
42
+    const char *v;
43
+
44
+    if (complained)
45
+	return;
46
+    complained = 1;
47
+    v = sqlite3_libversion();
48
+    sscanf(v, "%u.%u.%u", &vmaj, &vmin, &vpl);
49
+    if (vmaj > 3) return;
50
+    if (vmaj == 3 && vmin > 2) return;
51
+    if (vmaj == 3 && vmin == 2 && vpl >= 2) return;
52
+    fprintf(stderr,
53
+	    "\n"
54
+	    "WARNING: sqlite %s is not supported on %u-bit machines!\n"
55
+	    "WARNING: If you see bus errors, update sqlite to 3.2.2 or newer.\n"
56
+	    "\n",
57
+	    v, SIZEOF_LONG * 8);
58
+#endif
59
+}
60
+
61
 void *db_open(void *dummyenv, bfpath *bfp, dbmode_t mode)
62
 {
63
     int rc;
64
@@ -244,6 +279,8 @@
65
 
66
     (void)dummyenv;
67
 
68
+    check_sqlite_version();
69
+
70
     dbh = dbh_init(bfp);
71
 
72
     /* open database file */
73
@@ -320,16 +357,8 @@
74
      * dbh->insert is not here as it's needed earlier,
75
      * so it sets itself up lazily
76
      */
77
-#define PREP(cmd, ptr) \
78
-    { const char *tail; /* dummy */ \
79
-	if (sqlite3_prepare(dbh->db, cmd, strlen(cmd), ptr, &tail) != SQLITE_OK) { \
80
-	    print_error(__FILE__, __LINE__, "cannot compile %s: %s\n", cmd, sqlite3_errmsg(dbh->db)); \
81
-	    exit(EX_ERROR); \
82
-	} \
83
-    }
84
-
85
-    PREP("SELECT value FROM bogofilter WHERE key=? LIMIT 1;", &dbh->select);
86
-    PREP("DELETE FROM bogofilter WHERE(key = ?);", &dbh->delete);
87
+    dbh->select = sqlprep(dbh, "SELECT value FROM bogofilter WHERE key=? LIMIT 1;");
88
+    dbh->delete = sqlprep(dbh, "DELETE FROM bogofilter WHERE(key = ?);");
89
 
90
     /* check if byteswapped */
91
     {
92
@@ -398,7 +427,7 @@
93
     static char buf[80];
94
 
95
     if (!buf[0])
96
-	snprintf(buf, sizeof(buf), "SQLite %s", sqlite3_version);
97
+	snprintf(buf, sizeof(buf), "SQLite %s", sqlite3_libversion());
98
     return buf;
99
 }
100
 
101
@@ -426,8 +455,8 @@
102
 	dbh_t *dbh,		/**< database handle */
103
 	const char *func,	/**< function name to report in errors */
104
 	sqlite3_stmt *stmt,	/**< SQLite3 statement to execute/reset */
105
-	int retnotfound,	/**< return value if no rows found */
106
-	dbv_t *val		/**  OUT value from first row, NULL ok */
107
+	dbv_t *val,		/**< OUT value from first row, NULL ok */
108
+	int retnotfound		/**  return value if no rows found */
109
 	)
110
 {
111
     int rc;
112
@@ -468,25 +497,25 @@
113
     dbh_t *dbh = vhandle;
114
 
115
     sqlite3_bind_blob(dbh->delete, 1, key->data, key->leng, SQLITE_STATIC);
116
-    return sql_fastpath(dbh, "db_delete", dbh->delete, 0, NULL);
117
+    return sql_fastpath(dbh, "db_delete", dbh->delete, NULL, 0);
118
 }
119
 
120
 int db_set_dbvalue(void *vhandle, const dbv_t *key, const dbv_t *val) {
121
     dbh_t *dbh = vhandle;
122
 
123
     if (!dbh->insert)
124
-	PREP("INSERT OR REPLACE INTO bogofilter VALUES(?,?);",    &dbh->insert);
125
+	dbh->insert = sqlprep(dbh, "INSERT OR REPLACE INTO bogofilter VALUES(?,?);");
126
 
127
     sqlite3_bind_blob(dbh->insert, 1, key->data, key->leng, SQLITE_STATIC);
128
     sqlite3_bind_blob(dbh->insert, 2, val->data, val->leng, SQLITE_STATIC);
129
-    return sql_fastpath(dbh, "db_set_dbvalue", dbh->insert, 0, NULL);
130
+    return sql_fastpath(dbh, "db_set_dbvalue", dbh->insert, NULL, 0);
131
 }
132
 
133
 int db_get_dbvalue(void *vhandle, const dbv_t* key, /*@out@*/ dbv_t *val) {
134
     dbh_t *dbh = vhandle;
135
 
136
     sqlite3_bind_blob(dbh->select, 1, key->data, key->leng, SQLITE_STATIC);
137
-    return sql_fastpath(dbh, "db_get_dbvalue", dbh->select, DS_NOTFOUND, val);
138
+    return sql_fastpath(dbh, "db_get_dbvalue", dbh->select, val, DS_NOTFOUND);
139
 }
140
 
141
 ex_t db_foreach(void *vhandle, db_foreach_t hook, void *userdata) {
142
--- a/src/maint.c	25 Jun 2005 16:42:44 -0000	1.64
143
+++ b/src/maint.c	4 Jul 2005 18:41:20 -0000	1.65
144
@@ -19,8 +19,10 @@
145
 #include "datastore.h"
146
 #include "error.h"
147
 #include "charset.h"
148
+#ifndef	DISABLE_UNICODE
149
 #include "convert_unicode.h"
150
 #include "iconvert.h"
151
+#endif
152
 #include "maint.h"
153
 #include "transaction.h"
154
 #include "wordlists.h"

Return to bug 85421