View | Details | Raw Unified | Return to bug 71418
Collapse All | Expand All

(-)./Makefile (-13 / +16 lines)
Lines 40-45 Link Here
40
# If you do not want mutt to use the iconv library define:
40
# If you do not want mutt to use the iconv library define:
41
#  WITHOUT_MUTT_ICONV
41
#  WITHOUT_MUTT_ICONV
42
#
42
#
43
# If you want mutt to use the idn library define:
44
#  WITH_MUTT_IDN
45
#
43
# If you want to enable extended quoting functions define:
46
# If you want to enable extended quoting functions define:
44
#  WITH_MUTT_QUOTE_PATCH
47
#  WITH_MUTT_QUOTE_PATCH
45
#  This is a default knob and can be disabled by WITHOUT_MUTT_QUOTE_PATCH
48
#  This is a default knob and can be disabled by WITHOUT_MUTT_QUOTE_PATCH
Lines 59-68 Link Here
59
# If you want to read and post news with mutt define:
62
# If you want to read and post news with mutt define:
60
#  WITH_MUTT_NNTP
63
#  WITH_MUTT_NNTP
61
#
64
#
62
# If you want to use the SASL authentication features with your email server
63
# define
64
#  WITH_MUTT_CYRUS_SASL
65
#
66
# If you want to use the rethreading functions define:
65
# If you want to use the rethreading functions define:
67
#  WITH_MUTT_EDIT_THREADS
66
#  WITH_MUTT_EDIT_THREADS
68
#
67
#
Lines 115-121 Link Here
115
CONFIGURE_ARGS=	--enable-flock --disable-fcntl --with-ssl=${OPENSSLBASE} \
114
CONFIGURE_ARGS=	--enable-flock --disable-fcntl --with-ssl=${OPENSSLBASE} \
116
		--with-sharedir=${PREFIX}/share/mutt --with-docdir=${DOCSDIR} \
115
		--with-sharedir=${PREFIX}/share/mutt --with-docdir=${DOCSDIR} \
117
		--sysconfdir=${PREFIX}/etc --enable-external-dotlock \
116
		--sysconfdir=${PREFIX}/etc --enable-external-dotlock \
118
		--enable-pop --enable-imap
117
		--enable-pop --enable-imap --disable-warnings
119
.if defined(MUTT_CONFIGURE_ARGS)
118
.if defined(MUTT_CONFIGURE_ARGS)
120
CONFIGURE_ARGS+=	${MUTT_CONFIGURE_ARGS}
119
CONFIGURE_ARGS+=	${MUTT_CONFIGURE_ARGS}
121
.endif
120
.endif
Lines 203-216 Link Here
203
.elif defined(MUTT_USES_SLANG)
202
.elif defined(MUTT_USES_SLANG)
204
LIB_DEPENDS+=	slang.1:${PORTSDIR}/devel/libslang
203
LIB_DEPENDS+=	slang.1:${PORTSDIR}/devel/libslang
205
.endif
204
.endif
206
.if defined(WITH_MUTT_CYRUS_SASL)
207
BROKEN=		"mutt-devel's SASL code appears to be broken"
208
LIB_DEPENDS+=	sasl.8:${PORTSDIR}/security/cyrus-sasl
209
.endif
210
.if defined(WITH_MUTT_MAILDIR_HEADER_CACHE)
205
.if defined(WITH_MUTT_MAILDIR_HEADER_CACHE)
211
LIB_DEPENDS+=	db-4.2.2:${PORTSDIR}/databases/db42
206
LIB_DEPENDS+=	db-4.2.2:${PORTSDIR}/databases/db42
212
CFLAGS+=	-I${PREFIX}/include/db42
207
CFLAGS+=	-I${PREFIX}/include/db42
213
.endif
208
.endif
209
.if exists(${LOCALBASE}/lib/libidn.so)
210
WITH_MUTT_IDN=	yes
211
.endif
212
.if defined(WITH_MUTT_IDN)
213
LIB_DEPENDS+=   idn.15:${PORTSDIR}/devel/libidn
214
.endif
214
.if ! defined(WITHOUT_MUTT_SMIME_OUTLOOK_COMPAT)
215
.if ! defined(WITHOUT_MUTT_SMIME_OUTLOOK_COMPAT)
215
pre-configure::
216
pre-configure::
216
	@${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-smime-outlook
217
	@${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-smime-outlook
Lines 252-260 Link Here
252
CONFIGURE_ARGS+=	--with-slang=${PREFIX}
253
CONFIGURE_ARGS+=	--with-slang=${PREFIX}
253
PATCHFILES+=	patch-${VVV_PATCH_VERSION}.vvv.slang.gz:vvv
254
PATCHFILES+=	patch-${VVV_PATCH_VERSION}.vvv.slang.gz:vvv
254
.endif
255
.endif
255
.if defined(WITH_MUTT_CYRUS_SASL)
256
CONFIGURE_ARGS+=	--with-sasl=${LOCALBASE}
257
.endif
258
.if defined(WITHOUT_NLS)
256
.if defined(WITHOUT_NLS)
259
CONFIGURE_ARGS+=	--disable-nls
257
CONFIGURE_ARGS+=	--disable-nls
260
.endif
258
.endif
Lines 263-268 Link Here
263
.else
261
.else
264
CONFIGURE_ARGS+=	--with-libiconv-prefix=${PREFIX}
262
CONFIGURE_ARGS+=	--with-libiconv-prefix=${PREFIX}
265
.endif
263
.endif
264
.if defined(WITH_MUTT_IDN) 
265
CONFIGURE_ARGS+=	--with-idn
266
.else
267
CONFIGURE_ARGS+=	--without-idn
268
.endif
266
269
267
PATCH_DIST_STRIP=	-p1
270
PATCH_DIST_STRIP=	-p1
268
271
Lines 321-327 Link Here
321
.endif
324
.endif
322
.if defined(WITH_MUTT_MAILDIR_HEADER_CACHE)
325
.if defined(WITH_MUTT_MAILDIR_HEADER_CACHE)
323
SCRIPTS_ENV+=	MUTT_MAILDIR_HEADER_CACHE="yes"
326
SCRIPTS_ENV+=	MUTT_MAILDIR_HEADER_CACHE="yes"
324
CONFIGURE_ARGS+=	--enable-hcache
327
CONFIGURE_ARGS+=	--enable-hcache --without-gdbm --with-bdb
325
.endif
328
.endif
326
.if defined(WITH_MUTT_EDIT_THREADS)
329
.if defined(WITH_MUTT_EDIT_THREADS)
327
SCRIPTS_ENV+=	MUTT_EDIT_THREADS="yes"
330
SCRIPTS_ENV+=	MUTT_EDIT_THREADS="yes"
(-)./files/extra-patch-maildir-header-cache (-120 / +142 lines)
Lines 2-12 Link Here
2
--- a/PATCHES
2
--- a/PATCHES
3
+++ b/PATCHES
3
+++ b/PATCHES
4
@@ -0,0 +1 @@
4
@@ -0,0 +1 @@
5
+patch-1.5.6.tg.hcache.2
5
+patch-1.5.6.tg.hcache.6
6
diff -Nru a/configure.in b/configure.in
6
diff -Nru a/configure.in b/configure.in
7
--- a/configure.in	2004-08-18 09:43:09 +02:00
7
--- a/configure.in	2004-08-18 09:43:09 +02:00
8
+++ b/configure.in	2004-08-18 06:34:04 +02:00
8
+++ b/configure.in	2004-09-02 13:09:08 +02:00
9
@@ -768,6 +768,81 @@
9
@@ -768,6 +768,90 @@
10
 
10
 
11
         fi])
11
         fi])
12
 
12
 
Lines 19-84 Link Here
19
+    OLDCPPFLAGS="$CPPFLAGS"
19
+    OLDCPPFLAGS="$CPPFLAGS"
20
+    OLDLIBS="$LIBS"
20
+    OLDLIBS="$LIBS"
21
+
21
+
22
+    BDB_VERSIONS="db-4 db4 db-4.3 db4.3 db43 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db"
22
+    ac_prefer_gdbm=yes
23
+
23
+    AC_ARG_WITH(gdbm, [  --without-gdbm             Get rid of gdbm even if it is available ],
24
+    AC_MSG_CHECKING([for BerkeleyDB > 4.0])
24
+        ac_prefer_gdbm=$withval)
25
+    if test x$ac_prefer_gdbm != xno; then
26
+        CPPFLAGS="$OLDCPPFLAGS"
27
+        LIBS="$OLDLIBS -lgdbm";
28
+        AC_CACHE_CHECK(for gdbm_open, ac_cv_gdbmopen,[
29
+            ac_cv_gdbmopen=no
30
+            AC_TRY_LINK([#include <gdbm.h>],[gdbm_open(0,0,0,0,0);],[ac_cv_gdbmopen=yes])
31
+        ])
32
+    fi
25
+
33
+
26
+    for d in /opt/csw/bdb4 /opt /usr/local /usr; do
34
+    ac_bdb_prefix=yes
27
+        for v in `echo $BDB_VERSIONS .`; do
35
+    AC_ARG_WITH(bdb, [  --with-bdb[=DIR]          Use BerkeleyDB4 if gdbm is not available ],
28
+            if test -r "$d/include/$v/db.h"; then
36
+        ac_bdb_prefix=$withval)
29
+                BDB_INCLUDE_DIR="$d/include/$v"
37
+    if test x$ac_bdb_prefix != xno -a x$ac_cv_gdbmopen != xyes; then
30
+                break
38
+        test x$ac_bdb_prefix = xyes && ac_bdb_prefix="$mutt_cv_prefix /opt/csw/bdb4 /opt /usr/local /usr"
31
+            fi
39
+        for d in $ac_bdb_prefix; do
40
+            bdbpfx="$bdbpfx $d"
41
+            for v in BerkeleyDB.4.3 BerkeleyDB.4.2 BerkeleyDB.4.1; do
42
+                bdbpfx="$bdbpfx $d/$v"
43
+            done
32
+        done
44
+        done
33
+        for v in `echo $BDB_VERSIONS .`; do
45
+        BDB_VERSIONS="db-4 db4 db-4.3 db4.3 db43 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db ''"
34
+            if test -d "$d/lib/$v"; then
46
+        AC_MSG_CHECKING([for BerkeleyDB > 4.0])
35
+                BDB_LIB_DIR="$d/lib/$v"
47
+        for d in $bdbpfx; do
36
+                break
48
+            BDB_INCLUDE_DIR=""
37
+            fi
49
+            BDB_LIB_DIR=""
50
+            for v in / $BDB_VERSIONS; do
51
+                if test -r "$d/include/$v/db.h"; then
52
+                    BDB_INCLUDE_DIR="$d/include/$v"
53
+                    if test -d "$d/lib/$v"; then
54
+                        BDB_LIB_DIR="$d/lib/$v"
55
+                        for l in `echo $BDB_VERSIONS`; do
56
+                            CPPFLAGS="-I$BDB_INCLUDE_DIR $OLDCPPFLAGS"
57
+                            LIBS="$OLDLIBS -L$BDB_LIB_DIR -l$l"
58
+                            AC_TRY_LINK([
59
+                                #include <stdlib.h>
60
+                                #include <db.h>
61
+                            ],[
62
+                                DB *db = NULL;
63
+                                db->open(db,NULL,NULL,NULL,0,0,0);
64
+                            ],[
65
+                                ac_cv_dbcreate=yes
66
+                                BDB_LIB="$l"
67
+                                break
68
+                            ])
69
+                        done
70
+                        test x$ac_dbcreate = xyes && break
71
+                    fi
72
+                fi
73
+            done
74
+            test x$BDB_LIB != x && break
38
+        done
75
+        done
39
+        for v in BerkeleyDB.4.3 BerkeleyDB.4.2 BerkeleyDB.4.1; do
76
+        if test x$ac_cv_dbcreate = xyes; then
40
+            test -r "$d/$v/include/db.h" && BDB_INCLUDE_DIR="$d/$v/include"
77
+            AC_MSG_RESULT(yes)
41
+            test -d "$d/$v/lib" && BDB_LIB_DIR="$d/$v/lib"
78
+        else
42
+        done
79
+            AC_MSG_RESULT(no)
43
+        test x$BDB_INCLUDE_DIR = x -o x$BDB_LIB_DIR = x && continue
80
+        fi
44
+        for v in `echo $BDB_VERSIONS`; do
45
+            CPPFLAGS="$OLDCPPFLAGS -I$BDB_INCLUDE_DIR"
46
+            LIBS="$OLDLIBS -L$BDB_LIB_DIR -l$v"
47
+	    AC_TRY_LINK([
48
+		#include <stdlib.h>
49
+                #include <db.h>
50
+	    ],[
51
+                DB *db = NULL;
52
+                db->open(db,NULL,NULL,NULL,0,0,0);
53
+	    ],[
54
+                ac_cv_dbcreate=yes
55
+                BDB_LIB="$v"
56
+                break
57
+	    ])
58
+        done
59
+        test x$BDB_LIB != x && break
60
+    done
61
+
62
+    if test x$ac_cv_dbcreate = xyes; then
63
+        AC_MSG_RESULT(yes)
64
+    else
65
+        AC_MSG_RESULT(no)
66
+    fi
81
+    fi
67
+
82
+
68
+    CPPFLAGS="$OLDCPPFLAGS"
83
+    if test x$ac_cv_gdbmopen = xyes; then
69
+    LIBS="$OLDLIBS -lgdbm";
70
+    AC_CACHE_CHECK(for gdbm_open, ac_cv_gdbmopen,
71
+        [ac_cv_gdbmopen=no
72
+        AC_TRY_LINK([#include <gdbm.h>],[gdbm_open(0,0,0,0,0);],[ac_cv_gdbmopen=yes])])
73
+
74
+    if test x$ac_cv_dbcreate = xyes; then
75
+        CPPFLAGS="$OLDCPPFLAGS -I$BDB_INCLUDE_DIR"
76
+        LIBS="$OLDLIBS -L$BDB_LIB_DIR -l$BDB_LIB"
77
+        AC_DEFINE(HAVE_DB4, 1, [Sleepycat DB4 Support])
78
+    elif test x$ac_cv_gdbmopen = xyes; then
79
+        CPPFLAGS="$OLDCPPFLAGS"
84
+        CPPFLAGS="$OLDCPPFLAGS"
80
+        LIBS="$OLDLIBS -lgdbm";
85
+        LIBS="$OLDLIBS -lgdbm";
81
+        AC_DEFINE(HAVE_GDBM, 1, [GDBM Support])
86
+        AC_DEFINE(HAVE_GDBM, 1, [GDBM Support])
87
+    elif test x$ac_cv_dbcreate = xyes; then
88
+        CPPFLAGS="-I$BDB_INCLUDE_DIR $OLDCPPFLAGS"
89
+        LIBS="$OLDLIBS -L$BDB_LIB_DIR -l$BDB_LIB"
90
+        AC_DEFINE(HAVE_DB4, 1, [Sleepycat DB4 Support])
82
+    else
91
+    else
83
+        AC_MSG_ERROR(You need Sleepycat DB4 or GDBM for --enable-hcache)
92
+        AC_MSG_ERROR(You need Sleepycat DB4 or GDBM for --enable-hcache)
84
+    fi
93
+    fi
Lines 104-111 Link Here
104
 WHERE char *MhUnseen;
113
 WHERE char *MhUnseen;
105
diff -Nru a/hcache.c b/hcache.c
114
diff -Nru a/hcache.c b/hcache.c
106
--- /dev/null	Wed Dec 31 16:00:00 196900
115
--- /dev/null	Wed Dec 31 16:00:00 196900
107
+++ b/hcache.c	2004-08-26 22:32:53 +02:00
116
+++ b/hcache.c	2004-09-02 14:29:03 +02:00
108
@@ -0,0 +1,798 @@
117
@@ -0,0 +1,797 @@
109
+/*
118
+/*
110
+ * Copyright (C) 2004 Thomas Glanzmann <sithglan@stud.uni-erlangen.de>
119
+ * Copyright (C) 2004 Thomas Glanzmann <sithglan@stud.uni-erlangen.de>
111
+ * Copyright (C) 2004 Tobias Werth <sitowert@stud.uni-erlangen.de>
120
+ * Copyright (C) 2004 Tobias Werth <sitowert@stud.uni-erlangen.de>
Lines 133-139 Link Here
133
+#if HAVE_GDBM
142
+#if HAVE_GDBM
134
+#include <gdbm.h>
143
+#include <gdbm.h>
135
+#elif HAVE_DB4
144
+#elif HAVE_DB4
136
+#include <db42/db.h>
145
+#include <db.h>
137
+#endif
146
+#endif
138
+
147
+
139
+#include <errno.h>
148
+#include <errno.h>
Lines 514-520 Link Here
514
+{
523
+{
515
+	int crc = 0;
524
+	int crc = 0;
516
+
525
+
517
+	crc = crc32(crc, (unsigned char const *) "sithglan@stud.uni-erlangen.de[sithglan]|hcache.c|20040826203315|26242", mutt_strlen("sithglan@stud.uni-erlangen.de[sithglan]|hcache.c|20040826203315|26242"));
526
+	crc = crc32(crc, (unsigned char const *) "sithglan@stud.uni-erlangen.de[sithglan]|hcache.c|20040902122921|26232", mutt_strlen("sithglan@stud.uni-erlangen.de[sithglan]|hcache.c|20040902122921|26232"));
518
+
527
+
519
+#if HAVE_LANGINFO_CODESET
528
+#if HAVE_LANGINFO_CODESET
520
+	crc = crc32(crc, (unsigned char const *) Charset, mutt_strlen(Charset));
529
+	crc = crc32(crc, (unsigned char const *) Charset, mutt_strlen(Charset));
Lines 614-625 Link Here
614
+mutt_hcache_open(const char *path, const char *folder)
623
+mutt_hcache_open(const char *path, const char *folder)
615
+{
624
+{
616
+	struct header_cache *h = safe_calloc(1, sizeof(HEADER_CACHE));
625
+	struct header_cache *h = safe_calloc(1, sizeof(HEADER_CACHE));
626
+	int pagesize = atoi(HeaderCachePageSize) ? atoi(HeaderCachePageSize) : 16384;
617
+	h->db     = NULL;
627
+	h->db     = NULL;
618
+        h->folder = safe_strdup (folder);
628
+        h->folder = safe_strdup (folder);
619
+	h->crc    = generate_crc32();
629
+	h->crc    = generate_crc32();
620
+
630
+
621
+	int pagesize = atoi(HeaderCachePageSize) ? atoi(HeaderCachePageSize) : 16384;
622
+
623
+	if (! path || path[0] == '\0') {
631
+	if (! path || path[0] == '\0') {
624
+		FREE(& h->folder);
632
+		FREE(& h->folder);
625
+		FREE(& h);
633
+		FREE(& h);
Lines 1247-1332 Link Here
1247
 #ifdef ISPELL
1255
 #ifdef ISPELL
1248
diff -Nru a/mh.c b/mh.c
1256
diff -Nru a/mh.c b/mh.c
1249
--- a/mh.c	2004-08-18 09:43:13 +02:00
1257
--- a/mh.c	2004-08-18 09:43:13 +02:00
1250
+++ b/mh.c	2004-07-26 09:37:28 +02:00
1258
+++ b/mh.c	2004-09-03 14:33:12 +02:00
1251
@@ -779,11 +779,68 @@
1259
@@ -779,30 +779,79 @@
1252
   return r;
1260
   return r;
1253
 }
1261
 }
1254
 
1262
 
1255
+#if USE_HCACHE
1263
+#if USE_HCACHE
1256
+
1257
+static size_t maildir_hcache_keylen (const char *fn)
1264
+static size_t maildir_hcache_keylen (const char *fn)
1258
+{
1265
+{
1259
+  const char * p = strchr (fn, ':');
1266
+  const char * p = strchr (fn, ':');
1260
+  return p ? (size_t) (p - fn) : mutt_strlen(fn);
1267
+  return p ? (size_t) (p - fn) : mutt_strlen(fn);
1261
+}
1268
+}
1262
+
1269
+#endif
1263
 
1270
 
1264
 /* 
1271
 /* 
1265
  * This function does the second parsing pass for a maildir-style
1272
  * This function does the second parsing pass for a maildir-style
1266
  * folder.
1273
  * folder.
1267
  */
1274
  */
1268
+void maildir_delayed_parsing (CONTEXT * ctx, struct maildir *md)
1275
-
1269
+{
1276
 void maildir_delayed_parsing (CONTEXT * ctx, struct maildir *md)
1270
+	struct maildir *p;
1277
 {
1271
+	void *hc = NULL;
1278
   struct maildir *p;
1272
+	char fn[_POSIX_PATH_MAX];
1279
   char fn[_POSIX_PATH_MAX];
1273
+	void *data;
1280
+  int count;
1274
+	unsigned int size;
1281
 
1275
+	struct timeval *when = NULL;
1282
-  for (p = md; p; p = p->next)
1276
+	struct stat lastchanged;
1283
-    if (p && p->h && !p->header_parsed)
1277
+	int ret;
1284
-    {
1278
+
1285
-      snprintf (fn, sizeof (fn), "%s/%s", ctx->path, p->h->path);
1279
+	hc = mutt_hcache_open (HeaderCache, ctx->path);
1286
-      if (maildir_parse_message (ctx->magic, fn, p->h->old, p->h))
1287
-	p->header_parsed = 1;
1288
-      else
1289
-	mutt_free_header (&p->h);
1290
-    }
1291
+#if USE_HCACHE
1292
+  void *hc = NULL;
1293
+  void *data;
1294
+  unsigned int size;
1295
+  struct timeval *when = NULL;
1296
+  struct stat lastchanged;
1297
+  int ret;
1280
+
1298
+
1281
+	for (p = md; p; p = p->next) {
1299
+  hc = mutt_hcache_open (HeaderCache, ctx->path);
1282
+		if (! (p && p->h && !p->header_parsed)) {
1300
+#endif
1283
+			continue;
1284
+		}
1285
+
1301
+
1286
+		data      = mutt_hcache_fetch (hc, p->h->path + 3, &maildir_hcache_keylen);
1302
+  for (p = md, count = 0; p; p = p->next, count++)
1287
+		when      = (struct timeval *) data;
1303
+  {
1304
+    if (! (p && p->h && !p->header_parsed))
1305
+    	continue;
1288
+
1306
+
1289
+		snprintf(fn, sizeof (fn), "%s/%s", ctx->path, p->h->path);
1307
+#if USE_HCACHE
1308
+    data      = mutt_hcache_fetch (hc, p->h->path + 3, &maildir_hcache_keylen);
1309
+    when      = (struct timeval *) data;
1310
+#endif
1290
+
1311
+
1291
+		if (option(OPTHCACHEVERIFY)) {
1312
+    snprintf (fn, sizeof (fn), "%s/%s", ctx->path, p->h->path);
1292
+			ret = stat(fn, &lastchanged);
1293
+		} else {
1294
+			lastchanged.st_mtime = 0;
1295
+			ret = 0;
1296
+		}
1297
+
1313
+
1298
+		if (data != NULL
1314
+#if USE_HCACHE
1299
+		 && ret == 0
1315
+    if (option(OPTHCACHEVERIFY)) {
1300
+		 && lastchanged.st_mtime <= when->tv_sec) {
1316
+      ret = stat(fn, &lastchanged);
1301
+			p->h = mutt_hcache_restore ((unsigned char *)data, &p->h);
1317
+    } else {
1302
+			maildir_parse_flags (p->h, fn);
1318
+      lastchanged.st_mtime = 0;
1303
+
1319
+      ret = 0;
1304
+		} else if (maildir_parse_message (ctx->magic, fn, p->h->old, p->h)) {
1320
+    }
1305
+			maildir_parse_flags(p->h, fn);
1306
+			p->header_parsed = 1;
1307
+			mutt_hcache_store (hc, p->h->path + 3, p->h, 0, &maildir_hcache_keylen);
1308
+		} else {
1309
+			mutt_free_header (&p->h);
1310
+		}
1311
+		FREE(&data);
1312
+	}
1313
+	mutt_hcache_close (hc);
1314
+}
1315
+
1321
+
1316
+#else /* USE_HCACHE */
1322
+    if (data != NULL && !ret && lastchanged.st_mtime <= when->tv_sec)
1317
 
1323
+    {
1318
 void maildir_delayed_parsing (CONTEXT * ctx, struct maildir *md)
1324
+      p->h = mutt_hcache_restore ((unsigned char *)data, &p->h);
1319
 {
1325
+      maildir_parse_flags (p->h, fn);
1320
@@ -801,7 +858,7 @@
1326
+    } else
1321
     }
1327
+#endif
1328
+    if (maildir_parse_message (ctx->magic, fn, p->h->old, p->h))
1329
+    {
1330
+      p->header_parsed = 1;
1331
+      maildir_parse_flags (p->h, fn);
1332
+#if USE_HCACHE
1333
+      mutt_hcache_store (hc, p->h->path + 3, p->h, 0, &maildir_hcache_keylen);
1334
+#endif
1335
+    } else
1336
+      mutt_free_header (&p->h);
1337
+#if USE_HCACHE
1338
+    FREE(&data);
1339
+#endif
1340
+  }
1341
+#if USE_HCACHE
1342
+  mutt_hcache_close (hc);
1343
+#endif
1322
 }
1344
 }
1323
 
1345
 
1324
-
1346
-
1325
+#endif /* USE_HCACHE */
1347
-
1326
 
1327
 /* Read a MH/maildir style mailbox.
1348
 /* Read a MH/maildir style mailbox.
1328
  *
1349
  *
1329
@@ -1293,6 +1350,9 @@
1350
  * args:
1351
@@ -1293,6 +1342,9 @@
1330
 {
1352
 {
1331
   char path[_POSIX_PATH_MAX], tmp[_POSIX_PATH_MAX];
1353
   char path[_POSIX_PATH_MAX], tmp[_POSIX_PATH_MAX];
1332
   int i, j;
1354
   int i, j;
Lines 1336-1342 Link Here
1336
 
1358
 
1337
   if (ctx->magic == M_MH)
1359
   if (ctx->magic == M_MH)
1338
     i = mh_check_mailbox (ctx, index_hint);
1360
     i = mh_check_mailbox (ctx, index_hint);
1339
@@ -1302,6 +1362,11 @@
1361
@@ -1302,6 +1354,11 @@
1340
   if (i != 0)
1362
   if (i != 0)
1341
     return i;
1363
     return i;
1342
 
1364
 
Lines 1348-1354 Link Here
1348
   for (i = 0; i < ctx->msgcount; i++)
1370
   for (i = 0; i < ctx->msgcount; i++)
1349
   {
1371
   {
1350
     if (ctx->hdrs[i]->deleted
1372
     if (ctx->hdrs[i]->deleted
1351
@@ -1310,7 +1375,13 @@
1373
@@ -1310,7 +1367,13 @@
1352
       snprintf (path, sizeof (path), "%s/%s", ctx->path, ctx->hdrs[i]->path);
1374
       snprintf (path, sizeof (path), "%s/%s", ctx->path, ctx->hdrs[i]->path);
1353
       if (ctx->magic == M_MAILDIR
1375
       if (ctx->magic == M_MAILDIR
1354
 	  || (option (OPTMHPURGE) && ctx->magic == M_MH))
1376
 	  || (option (OPTMHPURGE) && ctx->magic == M_MH))
Lines 1362-1368 Link Here
1362
       else if (ctx->magic == M_MH)
1384
       else if (ctx->magic == M_MH)
1363
       {
1385
       {
1364
 	/* MH just moves files out of the way when you delete them */
1386
 	/* MH just moves files out of the way when you delete them */
1365
@@ -1332,16 +1403,21 @@
1387
@@ -1332,16 +1395,21 @@
1366
       if (ctx->magic == M_MAILDIR)
1388
       if (ctx->magic == M_MAILDIR)
1367
       {
1389
       {
1368
 	if (maildir_sync_message (ctx, i) == -1)
1390
 	if (maildir_sync_message (ctx, i) == -1)
Lines 1386-1392 Link Here
1386
   if (ctx->magic == M_MH)
1408
   if (ctx->magic == M_MH)
1387
     mh_update_sequences (ctx);
1409
     mh_update_sequences (ctx);
1388
 
1410
 
1389
@@ -1362,6 +1438,13 @@
1411
@@ -1362,6 +1430,13 @@
1390
   }
1412
   }
1391
 
1413
 
1392
   return 0;
1414
   return 0;
(-)./files/patch-01 (-20 lines)
Lines 1-20 Link Here
1
--- configure.in.orig	Thu May  2 01:21:49 2002
2
+++ configure.in	Wed Jul 17 17:08:49 2002
3
@@ -591,7 +591,7 @@
4
         then
5
           if test "$with_sasl" != "yes"
6
           then
7
-            CPPFLAGS="$CPPFLAGS -I$with_sasl/include"
8
+            CPPFLAGS="$CPPFLAGS -I$with_sasl/include/sasl1"
9
             LDFLAGS="$LDFLAGS -L$with_sasl/lib"
10
           fi
11
 
12
@@ -644,7 +644,7 @@
13
 fi])
14
 
15
 if test x$GCC = xyes -a $mutt_cv_warnings = yes; then
16
-        CFLAGS="-Wall -pedantic $CFLAGS"
17
+        CFLAGS="-Wall $CFLAGS"
18
 fi
19
 
20
 AC_ARG_ENABLE(nfs-fix, [  --enable-nfs-fix           Work around an NFS with broken attributes caching ],
(-)./files/patch-threadcomplete (-39 / +48 lines)
Lines 1-21 Link Here
1
diff -Nru a/PATCHES b/PATCHES
1
diff -Nru a/PATCHES b/PATCHES
2
--- PATCHES	2004-07-24 12:27:17 +02:00
2
--- PATCHES
3
+++ PATCHES	2004-08-22 02:01:52 +02:00
3
+++ PATCHES
4
@@ -0,0 +1 @@
4
@@ -0,0 +1 @@
5
+patch-1.5.6.cb.thread_pattern.1
5
+patch-1.5.6+20040904.tg.mutt-thread.3
6
diff -Nru a/doc/manual.sgml.head b/doc/manual.sgml.head
6
diff -Nru a/doc/manual.sgml.head b/doc/manual.sgml.head
7
--- doc/manual.sgml.head	2004-07-24 12:27:29 +02:00
7
--- doc/manual.sgml.head	2004-07-24 12:27:29 +02:00
8
+++ doc/manual.sgml.head	2004-08-25 14:54:08 +02:00
8
+++ doc/manual.sgml.head	2004-09-04 12:40:02 +02:00
9
@@ -1771,6 +1771,8 @@
9
@@ -1809,6 +1809,8 @@
10
 messages:
11
 
12
 <tscreen><verb>
13
+~a              messages in threads that contain at least one tagged message;
14
+                this is the same as ~(~T) [see below for ~(..)]
15
 ~A              all messages
16
 ~b EXPR         messages which contain EXPR in the message body
17
 ~B EXPR         messages which contain EXPR in the whole message
18
@@ -1809,6 +1811,8 @@
19
 ~y EXPR         messages which contain EXPR in the `X-Label' field
10
 ~y EXPR         messages which contain EXPR in the `X-Label' field
20
 ~z [MIN]-[MAX]  messages with a size in the range MIN to MAX *)
11
 ~z [MIN]-[MAX]  messages with a size in the range MIN to MAX *)
21
 ~=              duplicated messages (see $duplicate_threads)
12
 ~=              duplicated messages (see $duplicate_threads)
Lines 24-38 Link Here
24
 </verb></tscreen>
15
 </verb></tscreen>
25
 
16
 
26
 Where EXPR, USER, ID, and SUBJECT are 
17
 Where EXPR, USER, ID, and SUBJECT are 
18
 Where EXPR, USER, ID, and SUBJECT are 
27
diff -Nru a/mutt.h b/mutt.h
19
diff -Nru a/mutt.h b/mutt.h
28
--- mutt.h	2004-07-24 12:27:21 +02:00
20
--- mutt.h	2004-07-24 12:27:21 +02:00
29
+++ mutt.h	2004-08-25 14:04:40 +02:00
21
+++ mutt.h	2004-09-04 12:36:18 +02:00
30
@@ -207,10 +207,12 @@
22
@@ -211,6 +211,7 @@
31
   M_LIMIT,
32
   M_EXPIRED,
33
   M_SUPERSEDED,
34
+  M_THREADCOMPLETE,
35
 
36
   /* actions for mutt_pattern_comp/mutt_pattern_exec */
23
   /* actions for mutt_pattern_comp/mutt_pattern_exec */
37
   M_AND,
24
   M_AND,
38
   M_OR,
25
   M_OR,
Lines 42-57 Link Here
42
   M_COLLAPSED,
29
   M_COLLAPSED,
43
diff -Nru a/pattern.c b/pattern.c
30
diff -Nru a/pattern.c b/pattern.c
44
--- pattern.c	2004-07-24 12:27:23 +02:00
31
--- pattern.c	2004-07-24 12:27:23 +02:00
45
+++ pattern.c	2004-08-25 15:37:51 +02:00
32
+++ pattern.c	2004-09-04 12:37:52 +02:00
46
@@ -44,6 +44,7 @@
33
@@ -700,7 +700,7 @@
47
 }
48
 Flags[] =
49
 {
50
+  { 'a', M_THREADCOMPLETE,	0,		NULL },
51
   { 'A', M_ALL,			0,		NULL },
52
   { 'b', M_BODY,		M_FULL_MSG,	eat_regexp },
53
   { 'B', M_WHOLE_MSG,		M_FULL_MSG,	eat_regexp },
54
@@ -700,7 +701,7 @@
55
 pattern_t *mutt_pattern_comp (/* const */ char *s, int flags, BUFFER *err)
34
 pattern_t *mutt_pattern_comp (/* const */ char *s, int flags, BUFFER *err)
56
 {
35
 {
57
   pattern_t *curlist = NULL;
36
   pattern_t *curlist = NULL;
Lines 60-66 Link Here
60
   pattern_t *last = NULL;
39
   pattern_t *last = NULL;
61
   int not = 0;
40
   int not = 0;
62
   int alladdr = 0;
41
   int alladdr = 0;
63
@@ -755,6 +756,39 @@
42
@@ -755,6 +755,39 @@
64
 	alladdr = 0;
43
 	alladdr = 0;
65
 	break;
44
 	break;
66
       case '~':
45
       case '~':
Lines 100-106 Link Here
100
 	if (implicit && or)
79
 	if (implicit && or)
101
 	{
80
 	{
102
 	  /* A | B & C == (A | B) & C */
81
 	  /* A | B & C == (A | B) & C */
103
@@ -945,6 +979,30 @@
82
@@ -945,6 +978,29 @@
104
   return alladdr;
83
   return alladdr;
105
 }
84
 }
106
 
85
 
Lines 112-121 Link Here
112
+  if(!t)
91
+  if(!t)
113
+    return 0;
92
+    return 0;
114
+  h = t->message;
93
+  h = t->message;
115
+  if(!h)
94
+  if(h)
116
+    return 0;
95
+    if(mutt_pattern_exec(pat, flags, ctx, h))
117
+  if(mutt_pattern_exec(pat, flags, ctx, h))
96
+      return 1;
118
+    return 1;
119
+
97
+
120
+  if(up && (a=match_threadcomplete(pat, flags, ctx, t->parent,1,1,1,0)))
98
+  if(up && (a=match_threadcomplete(pat, flags, ctx, t->parent,1,1,1,0)))
121
+    return a;
99
+    return a;
Lines 131-137 Link Here
131
 /* flags
109
 /* flags
132
    	M_MATCH_FULL_ADDRESS	match both personal and machine address */
110
    	M_MATCH_FULL_ADDRESS	match both personal and machine address */
133
 int
111
 int
134
@@ -958,6 +1016,8 @@
112
@@ -958,6 +1014,8 @@
135
       return (pat->not ^ (perform_and (pat->child, flags, ctx, h) > 0));
113
       return (pat->not ^ (perform_and (pat->child, flags, ctx, h) > 0));
136
     case M_OR:
114
     case M_OR:
137
       return (pat->not ^ (perform_or (pat->child, flags, ctx, h) > 0));
115
       return (pat->not ^ (perform_or (pat->child, flags, ctx, h) > 0));
Lines 140-146 Link Here
140
     case M_ALL:
118
     case M_ALL:
141
       return (!pat->not);
119
       return (!pat->not);
142
     case M_EXPIRED:
120
     case M_EXPIRED:
143
@@ -1023,6 +1083,16 @@
121
--- doc/manual.sgml.head.orig2	Mon Sep  6 09:24:16 2004
122
+++ doc/manual.sgml.head	Mon Sep  6 09:25:41 2004
123
@@ -1773,6 +1773,8 @@
124
 messages:
125
 
126
 <tscreen><verb>
127
+~a              messages in threads that contain at least one tagged message;
128
+                this is the same as ~(~T) [see below for ~(..)]
129
 ~A              all messages
130
 ~b EXPR         messages which contain EXPR in the message body
131
 ~B EXPR         messages which contain EXPR in the whole message
132
--- mutt.h.orig2	Mon Sep  6 09:24:17 2004
133
+++ mutt.h	Mon Sep  6 09:27:04 2004
134
@@ -212,6 +212,7 @@
135
   M_LIMIT,
136
   M_EXPIRED,
137
   M_SUPERSEDED,
138
+  M_THREADCOMPLETE,
139
 
140
   /* actions for mutt_pattern_comp/mutt_pattern_exec */
141
   M_AND,
142
--- pattern.c.orig2	Mon Sep  6 09:24:10 2004
143
+++ pattern.c	Mon Sep  6 09:30:02 2004
144
@@ -44,6 +44,7 @@
145
 }
146
 Flags[] =
147
 {
148
+  { 'a', M_THREADCOMPLETE,	0,		NULL },
149
   { 'A', M_ALL,			0,		NULL },
150
   { 'b', M_BODY,		M_FULL_MSG,	eat_regexp },
151
   { 'B', M_WHOLE_MSG,		M_FULL_MSG,	eat_regexp },
152
@@ -1024,6 +1083,16 @@
144
 					pat->alladdr, 2, h->env->to, h->env->cc));
153
 					pat->alladdr, 2, h->env->to, h->env->cc));
145
     case M_LIST:
154
     case M_LIST:
146
       return (pat->not ^ mutt_is_list_recipient (pat->alladdr, h->env->to, h->env->cc));
155
       return (pat->not ^ mutt_is_list_recipient (pat->alladdr, h->env->to, h->env->cc));

Return to bug 71418