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

(-)./Makefile (-29 / +12 lines)
Lines 71-79 Link Here
71
# If you want mutt to use the ispell spelling checker define:
71
# If you want mutt to use the ispell spelling checker define:
72
#  WITH_MUTT_ISPELL
72
#  WITH_MUTT_ISPELL
73
#
73
#
74
# If you want to use the rethreading functions define:
75
#  WITH_MUTT_EDIT_THREADS
76
#
77
# If you want to use the signature menu define:
74
# If you want to use the signature menu define:
78
#  WITH_MUTT_SIGNATURE_MENU
75
#  WITH_MUTT_SIGNATURE_MENU
79
#
76
#
Lines 98-105 Link Here
98
#
95
#
99
96
100
PORTNAME=	mutt-devel
97
PORTNAME=	mutt-devel
101
PORTVERSION=	1.5.9
98
PORTVERSION=	1.5.10
102
PORTREVISION=	3
99
PORTREVISION=	0
103
CATEGORIES+=	mail ipv6
100
CATEGORIES+=	mail ipv6
104
.if defined(WITH_MUTT_NNTP)
101
.if defined(WITH_MUTT_NNTP)
105
CATEGORIES+=	news
102
CATEGORIES+=	news
Lines 185-190 Link Here
185
.error The WITH_MUTT_SIGNATURE_MENU does not work at the moment
182
.error The WITH_MUTT_SIGNATURE_MENU does not work at the moment
186
.endif
183
.endif
187
.if defined(WITH_MUTT_SIDEBAR_PATCH)
184
.if defined(WITH_MUTT_SIDEBAR_PATCH)
185
.error The WITH_MUTT_SIDEBAR_PATCH does not work at the moment
188
.if defined(WITH_MUTT_NNTP)
186
.if defined(WITH_MUTT_NNTP)
189
.error The WITH_MUTT_SIDEBAR_PATCH and WITH_MUTT_NNTP are not compatible
187
.error The WITH_MUTT_SIDEBAR_PATCH and WITH_MUTT_NNTP are not compatible
190
.endif
188
.endif
Lines 282-296 Link Here
282
LIB_DEPENDS+=	idn:${PORTSDIR}/devel/libidn
280
LIB_DEPENDS+=	idn:${PORTSDIR}/devel/libidn
283
.endif
281
.endif
284
.if ! defined(WITHOUT_MUTT_SMIME_OUTLOOK_COMPAT)
282
.if ! defined(WITHOUT_MUTT_SMIME_OUTLOOK_COMPAT)
285
pre-configure::
283
post-patch::
286
	@${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-smime-outlook
284
	@${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-smime-outlook
287
.endif
285
.endif
288
.if defined(WITH_MUTT_MAILDIR_HEADER_CACHE)
286
.if defined(WITH_MUTT_MAILDIR_HEADER_CACHE)
289
pre-configure::
287
post-patch::
290
	@${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-maildir-header-cache
288
	@${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-maildir-header-cache
291
.endif
289
.endif
292
.if defined(WITH_MUTT_MAILDIR_MTIME_PATCH)
290
.if defined(WITH_MUTT_MAILDIR_MTIME_PATCH)
293
pre-configure::
291
post-patch::
294
.if defined(WITH_MUTT_NNTP)
292
.if defined(WITH_MUTT_NNTP)
295
	@${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-maildir-mtime-nntp
293
	@${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-maildir-mtime-nntp
296
.else
294
.else
Lines 298-320 Link Here
298
.endif
296
.endif
299
.endif
297
.endif
300
298
301
.if defined(WITH_MUTT_EDIT_THREADS)
302
pre-configure::
303
	@${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-edit-threads
304
.endif
305
306
.if defined(WITH_MUTT_SIDEBAR_PATCH)
299
.if defined(WITH_MUTT_SIDEBAR_PATCH)
307
pre-configure::
300
post-patch::
308
	@${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-sidebar
301
	@${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-sidebar
309
.endif
302
.endif
310
303
311
.if defined(WITH_MUTT_ASPELL)
304
.if defined(WITH_MUTT_ASPELL)
312
pre-configure::
305
post-patch::
313
	@${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-aspell
306
	@${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-aspell
314
.endif
307
.endif
315
308
316
.if defined(WITH_MUTT_REVERSE_REPLY_PATCH)
309
.if defined(WITH_MUTT_REVERSE_REPLY_PATCH)
317
pre-configure::
310
post-patch::
318
	@${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-reverse_reply
311
	@${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-reverse_reply
319
.endif
312
.endif
320
313
Lines 375-384 Link Here
375
		patch-${VVV_PATCH_VERSION}.vvv.quote.gz:vvv
368
		patch-${VVV_PATCH_VERSION}.vvv.quote.gz:vvv
376
SGML_NEEDED=	yes
369
SGML_NEEDED=	yes
377
.endif
370
.endif
378
.if defined(WITH_MUTT_EDIT_THREADS)
379
CONFIGURE_ARGS+=	--enable-imap-edit-threads
380
SGML_NEEDED=	yes
381
.endif
382
.if defined(WITH_MUTT_SIGNATURE_MENU)
371
.if defined(WITH_MUTT_SIGNATURE_MENU)
383
PATCHFILES+=	patch-${CD_PATCH_VERSION}.cd.signatures_menu.2.1:cd
372
PATCHFILES+=	patch-${CD_PATCH_VERSION}.cd.signatures_menu.2.1:cd
384
SGML_NEEDED=	yes
373
SGML_NEEDED=	yes
Lines 429-447 Link Here
429
SCRIPTS_ENV+=	MUTT_QUOTE_PATCH="yes"
418
SCRIPTS_ENV+=	MUTT_QUOTE_PATCH="yes"
430
.endif
419
.endif
431
.if defined(WITH_MUTT_IMAP_HEADER_CACHE)
420
.if defined(WITH_MUTT_IMAP_HEADER_CACHE)
432
SCRIPTS_ENV+=	MUTT_IMAP_HEADER_CACHE="yes"
433
CONFIGURE_ARGS+=	--enable-hcache --without-gdbm --with-bdb
421
CONFIGURE_ARGS+=	--enable-hcache --without-gdbm --with-bdb
422
.else
423
CONFIGURE_ARGS+=	--disable-hcache
434
.endif
424
.endif
435
.if defined(WITH_MUTT_MAILDIR_HEADER_CACHE)
425
.if defined(WITH_MUTT_MAILDIR_HEADER_CACHE)
436
SCRIPTS_ENV+=	MUTT_MAILDIR_HEADER_CACHE="yes"
426
CONFIGURE_ARGS+=	 --disable-inodesort --without-qdbm
437
CONFIGURE_ARGS+=	 --disable-inodesort
438
.endif
427
.endif
439
.if defined(WITH_MUTT_SIDEBAR_PATCH)
428
.if defined(WITH_MUTT_SIDEBAR_PATCH)
440
SCRIPTS_ENV+=	MUTT_SIDEBAR_PATCH="yes"
429
SCRIPTS_ENV+=	MUTT_SIDEBAR_PATCH="yes"
441
.endif
430
.endif
442
.if defined(WITH_MUTT_EDIT_THREADS)
443
SCRIPTS_ENV+=	MUTT_EDIT_THREADS="yes"
444
.endif
445
.if defined(WITH_MUTT_SIGNATURE_MENU)
431
.if defined(WITH_MUTT_SIGNATURE_MENU)
446
SCRIPTS_ENV+=	MUTT_SIGNATURE_MENU="yes"
432
SCRIPTS_ENV+=	MUTT_SIGNATURE_MENU="yes"
447
.endif
433
.endif
Lines 453-461 Link Here
453
.endif
439
.endif
454
.if !defined(WITHOUT_NLS)
440
.if !defined(WITHOUT_NLS)
455
SCRIPTS_ENV+=	MUTT_NLS="yes"
441
SCRIPTS_ENV+=	MUTT_NLS="yes"
456
.endif
457
.if defined(WITH_MUTT_IDN)
458
SCRIPTS_ENV+=	MUTT_IDN="yes"
459
.endif
442
.endif
460
.if defined(WITH_MUTT_REVERSE_REPLY_PATCH)
443
.if defined(WITH_MUTT_REVERSE_REPLY_PATCH)
461
SCRIPTS_ENV+=	MUTT_REVERSE_REPLY_PATCH="yes"
444
SCRIPTS_ENV+=	MUTT_REVERSE_REPLY_PATCH="yes"
(-)./distinfo (-10 / +10 lines)
Lines 1-13 Link Here
1
MD5 (mutt/mutt-1.5.9i.tar.gz) = c5318eba3404ebd78a15c680fa1b6056
1
MD5 (mutt/mutt-1.5.10i.tar.gz) = 59400d12c6b5b3d122531000e53d1914
2
SIZE (mutt/mutt-1.5.9i.tar.gz) = 3036003
2
SIZE (mutt/mutt-1.5.10i.tar.gz) = 3156345
3
MD5 (mutt/patch-1.5.9.rr.compressed.gz) = 9d9ef4ec0e970f9fc3de2d5c6219a349
3
MD5 (mutt/patch-1.5.10.rr.compressed.gz) = f6cd5bd6c030d5d691d347a6e9d75b6a
4
SIZE (mutt/patch-1.5.9.rr.compressed.gz) = 10260
4
SIZE (mutt/patch-1.5.10.rr.compressed.gz) = 10095
5
MD5 (mutt/patch-1.5.9.vvv.nntp.gz) = f7cf37af82169eefe94c6c42c6f3b9cd
5
MD5 (mutt/patch-1.5.10.vvv.nntp.gz) = ac9a4c8bf25a96648bb08cde4ced4c05
6
SIZE (mutt/patch-1.5.9.vvv.nntp.gz) = 91518
6
SIZE (mutt/patch-1.5.10.vvv.nntp.gz) = 98153
7
MD5 (mutt/patch-1.5.9.vvv.initials.gz) = 149c52991b23b9ab3d6add27cb27e151
7
MD5 (mutt/patch-1.5.10.vvv.initials.gz) = 91eea7344625830bf4231dc1d56cb799
8
SIZE (mutt/patch-1.5.9.vvv.initials.gz) = 689
8
SIZE (mutt/patch-1.5.10.vvv.initials.gz) = 682
9
MD5 (mutt/patch-1.5.9.vvv.quote.gz) = 08329134d8995c05a28dd8258174a668
9
MD5 (mutt/patch-1.5.10.vvv.quote.gz) = 7d9b9c2d52318782d81d2ffb95576d48
10
SIZE (mutt/patch-1.5.9.vvv.quote.gz) = 1629
10
SIZE (mutt/patch-1.5.10.vvv.quote.gz) = 1580
11
MD5 (mutt/patch-1.5.4.cd.ifdef.1) = a545036cdb55519154d0b35465f52daa
11
MD5 (mutt/patch-1.5.4.cd.ifdef.1) = a545036cdb55519154d0b35465f52daa
12
SIZE (mutt/patch-1.5.4.cd.ifdef.1) = 3545
12
SIZE (mutt/patch-1.5.4.cd.ifdef.1) = 3545
13
MD5 (mutt/p0-patch-1.5.6.dw.mbox-hook.1) = 9e29a6778ab07a4de3442691e4573fea
13
MD5 (mutt/p0-patch-1.5.6.dw.mbox-hook.1) = 9e29a6778ab07a4de3442691e4573fea
(-)./files/extra-patch-maildir-header-cache (-187 / +236 lines)
Lines 2-207 Link Here
2
--- a/PATCHES
2
--- a/PATCHES
3
+++ b/PATCHES
3
+++ b/PATCHES
4
@@ -0,0 +1 @@
4
@@ -0,0 +1 @@
5
+mutt-cvs-header-cache.29
5
+mutt-cvs-header-cache.30
6
diff -Nru a/init.h b/init.h
6
--- a/configure.in
7
--- a/init.h	2005-02-12 22:08:19 +01:00
7
+++ b/configure.in
8
+++ b/init.h	2005-02-13 00:51:10 +01:00
8
@@ -804,10 +804,23 @@
9
@@ -1032,6 +1032,13 @@
9
     OLDLIBS="$LIBS"
10
   ** global header cache for all folders is used. Per default it is unset and so
10
 
11
   ** no header caching will be used.
11
     need_md5="yes"
12
   */
12
+
13
+  { "maildir_header_cache_verify", DT_BOOL, R_NONE, OPTHCACHEVERIFY, 1 },
13
+    ac_prefer_qdbm=yes
14
+  /*
14
+    AC_ARG_WITH(qdbm, AC_HELP_STRING([--without-qdbm], [Don't use qdbm even if it is available]),
15
+  ** .pp
15
+        ac_prefer_qdbm=$withval)
16
+  ** Check for Maildir unaware programs other than mutt having modified maildir
16
+    if test x$ac_prefer_qdbm != xno; then
17
+  ** files when the header cache is in use.  This incurs one stat(2) per
17
+        CPPFLAGS="$OLDCPPFLAGS"
18
+  ** message every time the folder is opened.
18
+        LIBS="$OLDLIBS -lqdbm";
19
+  */
19
+        AC_CACHE_CHECK(for vlopen, ac_cv_vlopen,[
20
   { "header_cache_pagesize", DT_STR, R_NONE, UL &HeaderCachePageSize, UL "16384" },
20
+            ac_cv_vlopen=no
21
   /*
21
+            AC_TRY_LINK([#include <villa.h>],[vlopen(0,0,0);],[ac_cv_vlopen=yes])
22
   ** .pp
22
+        ])
23
diff -Nru a/mh.c b/mh.c
23
+    fi
24
--- a/mh.c	2005-02-03 19:01:43 +01:00
24
+
25
+++ b/mh.c	2005-02-05 12:25:16 +01:00
25
     ac_prefer_gdbm=yes
26
@@ -791,6 +791,14 @@
26
     AC_ARG_WITH(gdbm, AC_HELP_STRING([--without-gdbm], [Don't use gdbm even if it is available]),
27
   return r;
27
         ac_prefer_gdbm=$withval)
28
-    if test x$ac_prefer_gdbm != xno; then
29
+    if test x$ac_prefer_gdbm != xno -a x$ac_cv_vlopen != xyes; then
30
         CPPFLAGS="$OLDCPPFLAGS"
31
         LIBS="$OLDLIBS -lgdbm";
32
         AC_CACHE_CHECK(for gdbm_open, ac_cv_gdbmopen,[
33
@@ -819,7 +832,7 @@
34
     ac_bdb_prefix=yes
35
     AC_ARG_WITH(bdb, AC_HELP_STRING([--with-bdb[=DIR]], [Use BerkeleyDB4 if gdbm is not available]),
36
         ac_bdb_prefix=$withval)
37
-    if test x$ac_bdb_prefix != xno -a x$ac_cv_gdbmopen != xyes; then
38
+    if test x$ac_bdb_prefix != xno -a x$ac_cv_gdbmopen != xyes -a x$ac_cv_vlopen != xyes; then
39
         test x$ac_bdb_prefix = xyes && ac_bdb_prefix="$mutt_cv_prefix /opt/csw/bdb4 /opt /usr/local /usr"
40
         for d in $ac_bdb_prefix; do
41
             bdbpfx="$bdbpfx $d"
42
@@ -865,7 +878,11 @@
43
         fi
44
     fi
45
 
46
-    if test x$ac_cv_gdbmopen = xyes; then
47
+    if test x$ac_cv_vlopen = xyes; then
48
+        CPPFLAGS="$OLDCPPFLAGS"
49
+        LIBS="$OLDLIBS -lqdbm";
50
+        AC_DEFINE(HAVE_QDBM, 1, [QDBM Support])
51
+    elif test x$ac_cv_gdbmopen = xyes; then
52
         CPPFLAGS="$OLDCPPFLAGS"
53
         LIBS="$OLDLIBS -lgdbm";
54
         AC_DEFINE(HAVE_GDBM, 1, [GDBM Support])
55
--- a/hcache.c
56
+++ b/hcache.c
57
@@ -22,7 +22,11 @@
58
 #include "config.h"
59
 #endif				/* HAVE_CONFIG_H */
60
 
61
-#if HAVE_GDBM
62
+#if HAVE_QDBM
63
+#include <depot.h>
64
+#include <cabin.h>
65
+#include <villa.h>
66
+#elif HAVE_GDBM
67
 #include <gdbm.h>
68
 #elif HAVE_DB4
69
 #include <db.h>
70
@@ -42,7 +46,14 @@
71
 #include "lib.h"
72
 #include "md5.h"
73
 
74
-#if HAVE_GDBM
75
+#if HAVE_QDBM
76
+static struct header_cache
77
+{
78
+  VILLA *db;
79
+  char *folder;
80
+  unsigned int crc;
81
+} HEADER_CACHE;
82
+#elif HAVE_GDBM
83
 static struct header_cache
84
 {
85
   GDBM_FILE db;
86
@@ -615,7 +626,139 @@
87
   return h;
28
 }
88
 }
29
 
89
 
30
+#if USE_HCACHE
90
-#if HAVE_GDBM
31
+static size_t maildir_hcache_keylen (const char *fn)
91
+#if HAVE_QDBM
92
+void *
93
+mutt_hcache_open(const char *path, const char *folder)
32
+{
94
+{
33
+  const char * p = strrchr (fn, ':');
95
+  struct header_cache *h = safe_calloc(1, sizeof (HEADER_CACHE));
34
+  return p ? (size_t) (p - fn) : mutt_strlen(fn);
96
+  int    flags = 0;
35
+}
97
+#if 0 /* FIXME */
36
+#endif
98
+  int pagesize = atoi(HeaderCachePageSize) ? atoi(HeaderCachePageSize) : 16384;
99
+#endif
100
+  h->db = NULL;
101
+  h->folder = safe_strdup(folder);
102
+  h->crc = generate_crc32();
37
+
103
+
38
 #ifdef USE_INODESORT
104
+  if (!path || path[0] == '\0')
39
 /*
105
+  {
40
  * Merge two maildir lists according to the inode numbers.
106
+    FREE(&h->folder);
41
@@ -886,27 +894,67 @@
107
+    FREE(&h);
42
  * This function does the second parsing pass for a maildir-style
108
+    return NULL;
43
  * folder.
109
+  }
44
  */
45
-
46
 void maildir_delayed_parsing (CONTEXT * ctx, struct maildir *md)
47
 {
48
   struct maildir *p;
49
   char fn[_POSIX_PATH_MAX];
50
   int count;
51
 
52
+#if USE_HCACHE
53
+  void *hc = NULL;
54
+  void *data;
55
+  struct timeval *when = NULL;
56
+  struct stat lastchanged;
57
+  int ret;
58
+
110
+
59
+  hc = mutt_hcache_open (HeaderCache, ctx->path);
111
+  path = mutt_hcache_per_folder(path, folder);
60
+#endif
61
+
112
+
62
   for (p = md, count = 0; p; p = p->next, count++)
113
+  if (option(OPTHCACHECOMPRESS))
63
-    if (p && p->h && !p->header_parsed)
114
+    flags = VL_OZCOMP;
64
-    {
115
+
65
-      if (!ctx->quiet && ReadInc && ((count % ReadInc) == 0 || count == 1))
116
+  h->db = vlopen(path, flags | VL_OWRITER | VL_OCREAT, VL_CMPLEX);
66
-	mutt_message (_("Reading %s... %d"), ctx->path, count);
117
+  if (h->db)
67
-      snprintf (fn, sizeof (fn), "%s/%s", ctx->path, p->h->path);
118
+    return h;
68
-      if (maildir_parse_message (ctx->magic, fn, p->h->old, p->h))
119
+
69
-	p->header_parsed = 1;
120
+  /* if rw failed try ro */
70
-      else
121
+  h->db = vlopen(path, flags | VL_OREADER, 0);
71
-	mutt_free_header (&p->h);
122
+  if (h->db)
72
-    }
123
+    return h;
73
-}
124
+  else
74
+  {
125
+  {
75
+    if (! (p && p->h && !p->header_parsed))
126
+    FREE(&h->folder);
76
+      continue;
127
+    FREE(&h);
77
 
128
+
78
+    if (!ctx->quiet && ReadInc && ((count % ReadInc) == 0 || count == 1))
129
+    return NULL;
79
+      mutt_message (_("Reading %s... %d"), ctx->path, count);
130
+  }
80
 
131
+}
81
+#if USE_HCACHE
82
+    data = mutt_hcache_fetch (hc, p->h->path + 3, &maildir_hcache_keylen);
83
+    when = (struct timeval *) data;
84
+#endif
85
+
132
+
86
+    snprintf (fn, sizeof (fn), "%s/%s", ctx->path, p->h->path);
133
+void
134
+mutt_hcache_close(void *db)
135
+{
136
+  struct header_cache *h = db;
137
+
138
+  if (!h)
139
+    return;
140
+
141
+  vlclose(h->db);
142
+  FREE(&h->folder);
143
+  FREE(&h);
144
+}
87
+
145
+
88
+#if USE_HCACHE
146
+void *
89
+    if (option(OPTHCACHEVERIFY))
147
+mutt_hcache_fetch(void *db, const char *filename,
90
+      ret = stat(fn, &lastchanged);
148
+		  size_t(*keylen) (const char *fn))
91
+    else {
149
+{
92
+      lastchanged.st_mtime = 0;
150
+  struct header_cache *h = db;
93
+      ret = 0;
151
+  char path[_POSIX_PATH_MAX];
152
+  int ksize;
153
+  char *data = NULL;
154
+
155
+  if (!h)
156
+    return NULL;
157
+
158
+  strncpy(path, h->folder, sizeof (path));
159
+  safe_strcat(path, sizeof (path), filename);
160
+
161
+  ksize = strlen(h->folder) + keylen(path + strlen(h->folder));
162
+
163
+  data = vlget(h->db, path, ksize, NULL);
164
+
165
+  if (! crc32_matches(data, h->crc))
166
+  {
167
+    if (data) { 
168
+      FREE(&data);
94
+    }
169
+    }
95
+    
170
+    return NULL;
96
+    if (data != NULL && !ret && lastchanged.st_mtime <= when->tv_sec)
97
+    {
98
+      p->h = mutt_hcache_restore ((unsigned char *)data, &p->h);
99
+      maildir_parse_flags (p->h, fn);
100
+    } else
101
+#endif
102
+    if (maildir_parse_message (ctx->magic, fn, p->h->old, p->h))
103
+    {
104
+      p->header_parsed = 1;
105
+#if USE_HCACHE
106
+      mutt_hcache_store (hc, p->h->path + 3, p->h, 0, &maildir_hcache_keylen);
107
+#endif
108
+    } else
109
+      mutt_free_header (&p->h);
110
+#if USE_HCACHE
111
+    FREE(&data);
112
+#endif
113
+  }
171
+  }
114
+#if USE_HCACHE
172
+
115
+  mutt_hcache_close (hc);
173
+  return data;
116
+#endif
117
+}
174
+}
175
+
176
+int
177
+mutt_hcache_store(void *db, const char *filename, HEADER * header,
178
+		  unsigned long uid_validity,
179
+		  size_t(*keylen) (const char *fn))
180
+{
181
+  struct header_cache *h = db;
182
+  char path[_POSIX_PATH_MAX];
183
+  int ret;
184
+  int ksize, dsize;
185
+  char *data = NULL;
186
+
187
+  if (!h)
188
+    return -1;
189
+
190
+  strncpy(path, h->folder, sizeof (path));
191
+  safe_strcat(path, sizeof (path), filename);
192
+
193
+  ksize = strlen(h->folder) + keylen(path + strlen(h->folder));
194
+
195
+  data  = mutt_hcache_dump(db, header, &dsize, uid_validity);
196
+
197
+  ret = vlput(h->db, path, ksize, data, dsize, VL_DOVER);
198
+
199
+  FREE(&data);
200
+
201
+  return ret;
202
+}
203
+
204
+int
205
+mutt_hcache_delete(void *db, const char *filename,
206
+		   size_t(*keylen) (const char *fn))
207
+{
208
+  struct header_cache *h = db;
209
+  char path[_POSIX_PATH_MAX];
210
+  int ksize;
211
+
212
+  if (!h)
213
+    return -1;
214
+
215
+  strncpy(path, h->folder, sizeof (path));
216
+  safe_strcat(path, sizeof (path), filename);
217
+
218
+  ksize = strlen(h->folder) + keylen(path + strlen(h->folder));
219
+
220
+  return vlout(h->db, path, ksize);
221
+}
222
+
223
+#elif HAVE_GDBM
118
 
224
 
119
 /* Read a MH/maildir style mailbox.
225
 void *
120
  *
226
 mutt_hcache_open(const char *path, const char *folder)
121
@@ -1403,6 +1451,9 @@
227
--- a/init.h
122
 {
228
+++ b/init.h
123
   char path[_POSIX_PATH_MAX], tmp[_POSIX_PATH_MAX];
229
@@ -1079,6 +1079,15 @@
124
   int i, j;
230
   ** files when the header cache is in use.  This incurs one stat(2) per
125
+#if USE_HCACHE
231
   ** message every time the folder is opened.
126
+  void *hc = NULL;
232
   */
127
+#endif /* USE_HCACHE */
233
+#if HAVE_QDBM
128
 
234
+  { "header_cache_compress", DT_BOOL, R_NONE, OPTHCACHECOMPRESS, 0 },
129
   if (ctx->magic == M_MH)
235
+  /*
130
     i = mh_check_mailbox (ctx, index_hint);
236
+  ** .pp
131
@@ -1412,6 +1463,11 @@
237
+  ** If enabled the header cache will be compressed. So only one fifth of the usual
132
   if (i != 0)
238
+  ** diskspace is used, but the uncompression can result in a slower open of the
133
     return i;
239
+  ** cached folder.
134
 
240
+  */
135
+#if USE_HCACHE
241
+#endif /* HAVE_QDBM */
136
+  if (ctx->magic == M_MAILDIR)
242
   { "header_cache_pagesize", DT_STR, R_NONE, UL &HeaderCachePageSize, UL "16384" },
137
+    hc = mutt_hcache_open(HeaderCache, ctx->path);
243
   /*
138
+#endif /* USE_HCACHE */
244
   ** .pp
139
+
245
--- a/mutt.h
140
   for (i = 0; i < ctx->msgcount; i++)
246
+++ b/mutt.h
141
   {
247
@@ -353,6 +353,9 @@
142
     if (ctx->hdrs[i]->deleted
143
@@ -1420,7 +1476,13 @@
144
       snprintf (path, sizeof (path), "%s/%s", ctx->path, ctx->hdrs[i]->path);
145
       if (ctx->magic == M_MAILDIR
146
 	  || (option (OPTMHPURGE) && ctx->magic == M_MH))
147
+      {
148
+#if USE_HCACHE
149
+        if (ctx->magic == M_MAILDIR)
150
+          mutt_hcache_delete (hc, ctx->hdrs[i]->path + 3, &maildir_hcache_keylen);
151
+#endif /* USE_HCACHE */
152
 	unlink (path);
153
+      }
154
       else if (ctx->magic == M_MH)
155
       {
156
 	/* MH just moves files out of the way when you delete them */
157
@@ -1442,16 +1504,21 @@
158
       if (ctx->magic == M_MAILDIR)
159
       {
160
 	if (maildir_sync_message (ctx, i) == -1)
161
-	  return -1;
162
+	  goto err;
163
       }
164
       else
165
       {
166
 	if (mh_sync_message (ctx, i) == -1)
167
-	  return -1;
168
+	  goto err;
169
       }
170
     }
171
   }
172
 
173
+#if USE_HCACHE
174
+  if (ctx->magic == M_MAILDIR)
175
+    mutt_hcache_close (hc);
176
+#endif /* USE_HCACHE */
177
+
178
   if (ctx->magic == M_MH)
179
     mh_update_sequences (ctx);
180
 
181
@@ -1472,6 +1539,13 @@
182
   }
183
 
184
   return 0;
185
+
186
+err:
187
+#if USE_HCACHE
188
+  if (ctx->magic == M_MAILDIR)
189
+    mutt_hcache_close (hc);
190
+#endif /* USE_HCACHE */
191
+  return -1;
192
 }
193
 
194
 static char *maildir_canon_filename (char *dest, const char *src, size_t l)
195
diff -Nru a/mutt.h b/mutt.h
196
--- a/mutt.h	2005-02-12 21:19:25 +01:00
197
+++ b/mutt.h	2005-02-13 00:51:10 +01:00
198
@@ -351,6 +351,9 @@
199
   OPTFORCENAME,
200
   OPTFORWDECODE,
201
   OPTFORWQUOTE,
248
   OPTFORWQUOTE,
202
+#if USE_HCACHE
249
 #if USE_HCACHE
203
+  OPTHCACHEVERIFY,
250
   OPTHCACHEVERIFY,
204
+#endif
251
+#if HAVE_QDBM
252
+  OPTHCACHECOMPRESS,
253
+#endif /* HAVE_QDBM */
254
 #endif
205
   OPTHDRS,
255
   OPTHDRS,
206
   OPTHEADER,
256
   OPTHEADER,
207
   OPTHELP,
(-)./files/extra-patch-nodoc-contrib (-7 / +7 lines)
Lines 9-28 Link Here
9
 
9
 
10
 bin_SCRIPTS = muttbug flea @SMIMEAUX_TARGET@
10
 bin_SCRIPTS = muttbug flea @SMIMEAUX_TARGET@
11
 
11
 
12
--- doc/Makefile.in.orig	Fri Feb  4 13:46:04 2005
12
--- doc/Makefile.in.orig	Sun Aug 14 11:35:31 2005
13
+++ doc/Makefile.in	Fri Feb  4 13:47:49 2005
13
+++ doc/Makefile.in	Sun Aug 14 11:37:23 2005
14
@@ -92,14 +92,6 @@
14
@@ -93,14 +93,6 @@
15
 	./instdoc muttrc.man $(DESTDIR)$(mandir)/man5/muttrc.5
15
 	./instdoc muttrc.man $(DESTDIR)$(mandir)/man5/muttrc.5
16
 	./instdoc $(srcdir)/mbox.man $(DESTDIR)$(mandir)/man5/mbox.5
16
 	./instdoc $(srcdir)/mbox.man $(DESTDIR)$(mandir)/man5/mbox.5
17
 	./instdoc $(srcdir)/mmdf.man $(DESTDIR)$(mandir)/man5/mmdf.5
17
 	./instdoc $(srcdir)/mmdf.man $(DESTDIR)$(mandir)/man5/mmdf.5
18
-	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(docdir)
18
-	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(docdir)
19
-	for f in $(srcdir_DOCFILES) ; do \
20
-		$(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(docdir) ; \
21
-	done
22
-	for f in $(topsrcdir_DOCFILES) ; do \
19
-	for f in $(topsrcdir_DOCFILES) ; do \
23
-		$(INSTALL) -m 644 $(top_srcdir)/$$f $(DESTDIR)$(docdir) ; \
20
-		$(INSTALL) -m 644 $(top_srcdir)/$$f $(DESTDIR)$(docdir) ; \
24
-	done
21
-	done
22
-	for f in $(srcdir_DOCFILES) ; do \
23
-		$(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(docdir) ; \
24
-	done
25
-	$(INSTALL) -m 644 manual.txt $(DESTDIR)$(docdir) || true
25
-	$(INSTALL) -m 644 manual.txt $(DESTDIR)$(docdir) || true
26
 
26
 
27
 uninstall:
27
 uninstall:
28
 	-rm -f $(DESTDIR)$(mandir)/man1/mutt.1
28
 	for f in mutt.1 mutt_dotlock.1 flea.1 muttbug.1 ; do \
(-)./files/extra-patch-sgmlformat (-1 / +1 lines)
Lines 5-11 Link Here
5
 	README NEWS TODO README.SECURITY README.SSL 
5
 	README NEWS TODO README.SECURITY README.SSL 
6
 
6
 
7
-all:
7
-all:
8
+all: muttrc.man try-html try-txt try-latin1 try-ps
8
+all: mutt.1 muttrc.man try-html try-txt try-latin1 try-ps
9
 
9
 
10
 try-html: ../makedoc
10
 try-html: ../makedoc
11
 	rm -f *.html && $(MAKE) manual.html || cp $(srcdir)/manual*.html ./
11
 	rm -f *.html && $(MAKE) manual.html || cp $(srcdir)/manual*.html ./
(-)./files/patch-02 (-14 / +14 lines)
Lines 1-34 Link Here
1
--- doc/Makefile.in.orig	Tue Feb 15 20:28:24 2005
1
--- doc/Makefile.in.orig	Thu Aug 11 21:37:02 2005
2
+++ doc/Makefile.in	Mon Mar 14 08:08:25 2005
2
+++ doc/Makefile.in	Sun Aug 14 11:09:10 2005
3
@@ -63,13 +63,23 @@
3
@@ -64,13 +64,23 @@
4
 	ChangeLog.old					\
4
 	ChangeLog.old					\
5
 	README NEWS TODO README.SECURITY README.SSL 
5
 	README NEWS TODO README.SECURITY README.SSL 
6
 
6
 
7
-all: muttrc.man try-html try-txt
7
-all: mutt.1 muttrc.man try-html try-txt
8
+all:
8
+all:
9
 
9
 
10
 try-html: ../makedoc
10
 try-html: ../makedoc$(EXEEXT)
11
-	test -f manual.html || $(MAKE) manual.html || cp $(srcdir)/manual*.html ./
11
-	test -f manual.html || $(MAKE) manual.html || cp $(srcdir)/manual*.html ./
12
+	rm -f *.html && $(MAKE) manual.html || cp $(srcdir)/manual*.html ./
12
+	rm -f *.html && $(MAKE) manual.html || cp $(srcdir)/manual*.html ./
13
+	touch $@
13
+	touch $@
14
 
14
 
15
 try-txt: ../makedoc
15
 try-txt: ../makedoc$(EXEEXT)
16
-	test -f manual.txt || $(MAKE) manual.txt || cp $(srcdir)/manual.txt ./
16
-	test -f manual.txt || $(MAKE) manual.txt || cp $(srcdir)/manual.txt ./
17
+	$(MAKE) manual.txt || cp $(srcdir)/manual.txt ./
17
+	$(MAKE) manual.txt || cp $(srcdir)/manual.txt ./
18
+	touch $@
18
+	touch $@
19
+
19
+
20
+try-latin1: 
20
+try-latin1: ../makedoc$(EXEEXT)
21
+	$(MAKE) manual.latin1 || cp $(srcdir)/manual.latin1 ./
21
+	$(MAKE) manual.latin1 || cp $(srcdir)/manual.latin1 ./
22
+	touch $@
22
+	touch $@
23
+
23
+
24
+try-ps: 
24
+try-ps: ../makedoc$(EXEEXT)
25
+	$(MAKE) manual.ps || cp $(srcdir)/manual.ps ./
25
+	$(MAKE) manual.ps || cp $(srcdir)/manual.latin1 ./
26
+	touch $@
26
+	touch $@
27
 
27
 
28
 install: all instdoc
28
 install: all instdoc
29
 	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man1
29
 	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man1
30
@@ -90,10 +100,6 @@
30
@@ -91,10 +101,6 @@
31
 		$(INSTALL) -m 644 $(top_srcdir)/$$f $(DESTDIR)$(docdir) ; \
31
 		$(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(docdir) ; \
32
 	done
32
 	done
33
 	$(INSTALL) -m 644 manual.txt $(DESTDIR)$(docdir) || true
33
 	$(INSTALL) -m 644 manual.txt $(DESTDIR)$(docdir) || true
34
-	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(docdir)/html
34
-	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(docdir)/html
Lines 37-48 Link Here
37
-	done
37
-	done
38
 
38
 
39
 uninstall:
39
 uninstall:
40
 	-rm -f $(DESTDIR)$(mandir)/man1/mutt.1
40
 	for f in mutt.1 mutt_dotlock.1 flea.1 muttbug.1 ; do \
41
@@ -103,17 +109,20 @@
41
@@ -114,17 +120,20 @@
42
 
42
 
43
 check:
43
 check:
44
 manual.txt: manual.sgml
44
 manual.txt: manual.sgml
45
-	if linuxdoc -B txt --pass='-P -c' manual ; then \
45
-	if linuxdoc -B txt -c latin --pass='-P -c' manual ; then \
46
-		uniq < manual.txt | expand > _manual.txt ; \
46
-		uniq < manual.txt | expand > _manual.txt ; \
47
-		rm manual.txt ; \
47
-		rm manual.txt ; \
48
+	if sgmlfmt -f ascii manual; then \
48
+	if sgmlfmt -f ascii manual; then \
(-)./files/patch-doc-mutt.1 (+11 lines)
Line 0 Link Here
1
--- doc/Makefile.in.orig	Sun Aug 14 11:27:21 2005
2
+++ doc/Makefile.in	Sun Aug 14 11:28:38 2005
3
@@ -179,7 +179,7 @@
4
 	-e 's,@docdir\@,$(docdir),g'
5
 
6
 mutt.1: $(srcdir)/mutt.man
7
-	$(EDIT) $< > $@
8
+	$(EDIT) $(srcdir)/mutt.man > $@
9
 
10
 muttrc.man stamp-doc-man: ../makedoc$(EXEEXT) $(top_srcdir)/init.h muttrc.man.head muttrc.man.tail
11
 	$(MAKEDOC_CPP) $(top_srcdir)/init.h | ../makedoc -m | 	    \
(-)./files/patch-doc-mutt.man (-14 lines)
Lines 1-17 Link Here
1
--- doc/mutt.man.orig	Wed Nov 13 11:07:05 2002
2
+++ doc/mutt.man	Wed Sep 24 15:36:17 2003
3
@@ -148,9 +148,9 @@
4
 User's personal mapping between MIME types and file extensions.
5
 .IP "/etc/mime.types"
6
 System mapping between MIME types and file extensions.
7
-.IP "/usr/local/bin/mutt_dotlock"
8
+.IP "${PREFIX}/bin/mutt_dotlock"
9
 The privileged dotlocking program.
10
-.IP "/usr/local/doc/mutt/manual.txt"
11
+.IP "${DOCSDIR}/manual.txt"
12
 The Mutt manual.
13
 .SH BUGS
14
 .PP
15
--- doc/muttrc.man.orig	Wed Mar 19 22:55:03 2003
1
--- doc/muttrc.man.orig	Wed Mar 19 22:55:03 2003
16
+++ doc/muttrc.man	Sun Oct 26 11:16:05 2003
2
+++ doc/muttrc.man	Sun Oct 26 11:16:05 2003
17
@@ -1031,7 +1031,7 @@
3
@@ -1031,7 +1031,7 @@
(-)./scripts/generate-plist (-13 / +1 lines)
Lines 126-132 Link Here
126
  fi
126
  fi
127
127
128
  if [ "$MUTT_HTML" = "yes" ]; then
128
  if [ "$MUTT_HTML" = "yes" ]; then
129
    html=383
129
    html=395
130
    if [ "$MUTT_COMPRESSED_FOLDERS" = "yes" ]; then
130
    if [ "$MUTT_COMPRESSED_FOLDERS" = "yes" ]; then
131
      html=$(($html + 5))
131
      html=$(($html + 5))
132
    fi
132
    fi
Lines 136-150 Link Here
136
    if [ "$MUTT_QUOTE_PATCH" = "yes" ]; then
136
    if [ "$MUTT_QUOTE_PATCH" = "yes" ]; then
137
      html=$(($html + 2))
137
      html=$(($html + 2))
138
    fi
138
    fi
139
    if [ "$MUTT_EDIT_THREADS" = "yes" ]; then
140
      html=$(($html + 3))
141
    fi
142
    if [ "$MUTT_IMAP_HEADER_CACHE" = "yes" ]; then
143
      html=$(($html + 2))
144
    fi
145
    if [ "$MUTT_MAILDIR_HEADER_CACHE" = "yes" ]; then
146
      html=$(($html + 1))
147
    fi
148
    if [ "$MUTT_SIDEBAR_PATCH" = "yes" ]; then
139
    if [ "$MUTT_SIDEBAR_PATCH" = "yes" ]; then
149
      html=$(($html + 2))
140
      html=$(($html + 2))
150
    fi
141
    fi
Lines 152-160 Link Here
152
      html=$(($html + 1))
143
      html=$(($html + 1))
153
    fi
144
    fi
154
    if [ "$MUTT_IFDEF_PATCH" = "yes" ]; then
145
    if [ "$MUTT_IFDEF_PATCH" = "yes" ]; then
155
      html=$(($html + 1))
156
    fi
157
    if [ "$MUTT_IDN" = "yes" ]; then
158
      html=$(($html + 1))
146
      html=$(($html + 1))
159
    fi
147
    fi
160
    if [ "$MUTT_REVERSE_REPLY_PATCH" = "yes" ]; then
148
    if [ "$MUTT_REVERSE_REPLY_PATCH" = "yes" ]; then

Return to bug 84907