Maintainer update of mail/mutt-devel: - Update to mutt-1.5.10 - Update the maildir header cache patch - Change the target when extra-patches are applied from pre-configure to post-patch, so users with local patches can apply them after a "make patch" and then already applied extra-patches. Commiter: new file (cvs add) files/patch-doc-mutt.1 If this is committed PR 84551 can also be closed as that patch is included also here.
Responsible Changed From-To: freebsd-ports-bugs->garga I'll take it.
OK, here's an updated patch with a working SIDEBAR patch. Still true: - Commiter: new file (cvs add) files/patch-doc-mutt.1 - If this is committed PR 84551 can also be closed as that patch is included also here. diff -ru /usr/ports/mail/mutt-devel/Makefile ./Makefile --- /usr/ports/mail/mutt-devel/Makefile Mon Jul 4 04:49:05 2005 +++ ./Makefile Tue Aug 16 17:33:35 2005 @@ -71,9 +71,6 @@ # If you want mutt to use the ispell spelling checker define: # WITH_MUTT_ISPELL # -# If you want to use the rethreading functions define: -# WITH_MUTT_EDIT_THREADS -# # If you want to use the signature menu define: # WITH_MUTT_SIGNATURE_MENU # @@ -98,8 +95,8 @@ # PORTNAME= mutt-devel -PORTVERSION= 1.5.9 -PORTREVISION= 3 +PORTVERSION= 1.5.10 +PORTREVISION= 0 CATEGORIES+= mail ipv6 .if defined(WITH_MUTT_NNTP) CATEGORIES+= news @@ -282,15 +279,15 @@ LIB_DEPENDS+= idn:${PORTSDIR}/devel/libidn .endif .if ! defined(WITHOUT_MUTT_SMIME_OUTLOOK_COMPAT) -pre-configure:: +post-patch:: @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-smime-outlook .endif .if defined(WITH_MUTT_MAILDIR_HEADER_CACHE) -pre-configure:: +post-patch:: @${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-maildir-header-cache .endif .if defined(WITH_MUTT_MAILDIR_MTIME_PATCH) -pre-configure:: +post-patch:: .if defined(WITH_MUTT_NNTP) @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-maildir-mtime-nntp .else @@ -298,23 +295,18 @@ .endif .endif -.if defined(WITH_MUTT_EDIT_THREADS) -pre-configure:: - @${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-edit-threads -.endif - .if defined(WITH_MUTT_SIDEBAR_PATCH) -pre-configure:: +post-patch:: @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-sidebar .endif .if defined(WITH_MUTT_ASPELL) -pre-configure:: +post-patch:: @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-aspell .endif .if defined(WITH_MUTT_REVERSE_REPLY_PATCH) -pre-configure:: +post-patch:: @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-reverse_reply .endif @@ -375,10 +367,6 @@ patch-${VVV_PATCH_VERSION}.vvv.quote.gz:vvv SGML_NEEDED= yes .endif -.if defined(WITH_MUTT_EDIT_THREADS) -CONFIGURE_ARGS+= --enable-imap-edit-threads -SGML_NEEDED= yes -.endif .if defined(WITH_MUTT_SIGNATURE_MENU) PATCHFILES+= patch-${CD_PATCH_VERSION}.cd.signatures_menu.2.1:cd SGML_NEEDED= yes @@ -391,7 +379,7 @@ PATCHFILES+= p0-patch-${DW_MBOX_PATCH_VERSION}.dw.mbox-hook.1:dw .endif .if defined(WITH_MUTT_SIDEBAR_PATCH) -SIDEBAR_PATCH= patch-1.5.9i.sidebar.20050628.txt +SIDEBAR_PATCH= patch-1.5.10i.sidebar.20050816.txt DISTFILES+= $(SIDEBAR_PATCH):thomer SGML_NEEDED= yes pre-patch:: @@ -429,19 +417,16 @@ SCRIPTS_ENV+= MUTT_QUOTE_PATCH="yes" .endif .if defined(WITH_MUTT_IMAP_HEADER_CACHE) -SCRIPTS_ENV+= MUTT_IMAP_HEADER_CACHE="yes" CONFIGURE_ARGS+= --enable-hcache --without-gdbm --with-bdb +.else +CONFIGURE_ARGS+= --disable-hcache .endif .if defined(WITH_MUTT_MAILDIR_HEADER_CACHE) -SCRIPTS_ENV+= MUTT_MAILDIR_HEADER_CACHE="yes" -CONFIGURE_ARGS+= --disable-inodesort +CONFIGURE_ARGS+= --disable-inodesort --without-qdbm .endif .if defined(WITH_MUTT_SIDEBAR_PATCH) SCRIPTS_ENV+= MUTT_SIDEBAR_PATCH="yes" .endif -.if defined(WITH_MUTT_EDIT_THREADS) -SCRIPTS_ENV+= MUTT_EDIT_THREADS="yes" -.endif .if defined(WITH_MUTT_SIGNATURE_MENU) SCRIPTS_ENV+= MUTT_SIGNATURE_MENU="yes" .endif @@ -453,9 +438,6 @@ .endif .if !defined(WITHOUT_NLS) SCRIPTS_ENV+= MUTT_NLS="yes" -.endif -.if defined(WITH_MUTT_IDN) -SCRIPTS_ENV+= MUTT_IDN="yes" .endif .if defined(WITH_MUTT_REVERSE_REPLY_PATCH) SCRIPTS_ENV+= MUTT_REVERSE_REPLY_PATCH="yes" diff -ru /usr/ports/mail/mutt-devel/distinfo ./distinfo --- /usr/ports/mail/mutt-devel/distinfo Mon Jul 4 04:49:05 2005 +++ ./distinfo Tue Aug 16 17:33:35 2005 @@ -1,16 +1,16 @@ -MD5 (mutt/mutt-1.5.9i.tar.gz) = c5318eba3404ebd78a15c680fa1b6056 -SIZE (mutt/mutt-1.5.9i.tar.gz) = 3036003 -MD5 (mutt/patch-1.5.9.rr.compressed.gz) = 9d9ef4ec0e970f9fc3de2d5c6219a349 -SIZE (mutt/patch-1.5.9.rr.compressed.gz) = 10260 -MD5 (mutt/patch-1.5.9.vvv.nntp.gz) = f7cf37af82169eefe94c6c42c6f3b9cd -SIZE (mutt/patch-1.5.9.vvv.nntp.gz) = 91518 -MD5 (mutt/patch-1.5.9.vvv.initials.gz) = 149c52991b23b9ab3d6add27cb27e151 -SIZE (mutt/patch-1.5.9.vvv.initials.gz) = 689 -MD5 (mutt/patch-1.5.9.vvv.quote.gz) = 08329134d8995c05a28dd8258174a668 -SIZE (mutt/patch-1.5.9.vvv.quote.gz) = 1629 +MD5 (mutt/mutt-1.5.10i.tar.gz) = 59400d12c6b5b3d122531000e53d1914 +SIZE (mutt/mutt-1.5.10i.tar.gz) = 3156345 +MD5 (mutt/patch-1.5.10.rr.compressed.gz) = f6cd5bd6c030d5d691d347a6e9d75b6a +SIZE (mutt/patch-1.5.10.rr.compressed.gz) = 10095 +MD5 (mutt/patch-1.5.10.vvv.nntp.gz) = ac9a4c8bf25a96648bb08cde4ced4c05 +SIZE (mutt/patch-1.5.10.vvv.nntp.gz) = 98153 +MD5 (mutt/patch-1.5.10.vvv.initials.gz) = 91eea7344625830bf4231dc1d56cb799 +SIZE (mutt/patch-1.5.10.vvv.initials.gz) = 682 +MD5 (mutt/patch-1.5.10.vvv.quote.gz) = 7d9b9c2d52318782d81d2ffb95576d48 +SIZE (mutt/patch-1.5.10.vvv.quote.gz) = 1580 MD5 (mutt/patch-1.5.4.cd.ifdef.1) = a545036cdb55519154d0b35465f52daa SIZE (mutt/patch-1.5.4.cd.ifdef.1) = 3545 MD5 (mutt/p0-patch-1.5.6.dw.mbox-hook.1) = 9e29a6778ab07a4de3442691e4573fea SIZE (mutt/p0-patch-1.5.6.dw.mbox-hook.1) = 6405 -MD5 (mutt/patch-1.5.9i.sidebar.20050628.txt) = da1311e36e74e58037de7d231983fd47 -SIZE (mutt/patch-1.5.9i.sidebar.20050628.txt) = 46571 +MD5 (mutt/patch-1.5.10i.sidebar.20050816.txt) = da7f5094a408369992008cf0f951774d +SIZE (mutt/patch-1.5.10i.sidebar.20050816.txt) = 47544 diff -ru /usr/ports/mail/mutt-devel/files/extra-patch-maildir-header-cache ./files/extra-patch-maildir-header-cache --- /usr/ports/mail/mutt-devel/files/extra-patch-maildir-header-cache Mon Mar 14 12:59:12 2005 +++ ./files/extra-patch-maildir-header-cache Sun Aug 14 13:18:43 2005 @@ -2,206 +2,255 @@ --- a/PATCHES +++ b/PATCHES @@ -0,0 +1 @@ -+mutt-cvs-header-cache.29 -diff -Nru a/init.h b/init.h ---- a/init.h 2005-02-12 22:08:19 +01:00 -+++ b/init.h 2005-02-13 00:51:10 +01:00 -@@ -1032,6 +1032,13 @@ - ** global header cache for all folders is used. Per default it is unset and so - ** no header caching will be used. - */ -+ { "maildir_header_cache_verify", DT_BOOL, R_NONE, OPTHCACHEVERIFY, 1 }, -+ /* -+ ** .pp -+ ** Check for Maildir unaware programs other than mutt having modified maildir -+ ** files when the header cache is in use. This incurs one stat(2) per -+ ** message every time the folder is opened. -+ */ - { "header_cache_pagesize", DT_STR, R_NONE, UL &HeaderCachePageSize, UL "16384" }, - /* - ** .pp -diff -Nru a/mh.c b/mh.c ---- a/mh.c 2005-02-03 19:01:43 +01:00 -+++ b/mh.c 2005-02-05 12:25:16 +01:00 -@@ -791,6 +791,14 @@ - return r; ++mutt-cvs-header-cache.30 +--- a/configure.in ++++ b/configure.in +@@ -804,10 +804,23 @@ + OLDLIBS="$LIBS" + + need_md5="yes" ++ ++ ac_prefer_qdbm=yes ++ AC_ARG_WITH(qdbm, AC_HELP_STRING([--without-qdbm], [Don't use qdbm even if it is available]), ++ ac_prefer_qdbm=$withval) ++ if test x$ac_prefer_qdbm != xno; then ++ CPPFLAGS="$OLDCPPFLAGS" ++ LIBS="$OLDLIBS -lqdbm"; ++ AC_CACHE_CHECK(for vlopen, ac_cv_vlopen,[ ++ ac_cv_vlopen=no ++ AC_TRY_LINK([#include <villa.h>],[vlopen(0,0,0);],[ac_cv_vlopen=yes]) ++ ]) ++ fi ++ + ac_prefer_gdbm=yes + AC_ARG_WITH(gdbm, AC_HELP_STRING([--without-gdbm], [Don't use gdbm even if it is available]), + ac_prefer_gdbm=$withval) +- if test x$ac_prefer_gdbm != xno; then ++ if test x$ac_prefer_gdbm != xno -a x$ac_cv_vlopen != xyes; then + CPPFLAGS="$OLDCPPFLAGS" + LIBS="$OLDLIBS -lgdbm"; + AC_CACHE_CHECK(for gdbm_open, ac_cv_gdbmopen,[ +@@ -819,7 +832,7 @@ + ac_bdb_prefix=yes + AC_ARG_WITH(bdb, AC_HELP_STRING([--with-bdb[=DIR]], [Use BerkeleyDB4 if gdbm is not available]), + ac_bdb_prefix=$withval) +- if test x$ac_bdb_prefix != xno -a x$ac_cv_gdbmopen != xyes; then ++ if test x$ac_bdb_prefix != xno -a x$ac_cv_gdbmopen != xyes -a x$ac_cv_vlopen != xyes; then + test x$ac_bdb_prefix = xyes && ac_bdb_prefix="$mutt_cv_prefix /opt/csw/bdb4 /opt /usr/local /usr" + for d in $ac_bdb_prefix; do + bdbpfx="$bdbpfx $d" +@@ -865,7 +878,11 @@ + fi + fi + +- if test x$ac_cv_gdbmopen = xyes; then ++ if test x$ac_cv_vlopen = xyes; then ++ CPPFLAGS="$OLDCPPFLAGS" ++ LIBS="$OLDLIBS -lqdbm"; ++ AC_DEFINE(HAVE_QDBM, 1, [QDBM Support]) ++ elif test x$ac_cv_gdbmopen = xyes; then + CPPFLAGS="$OLDCPPFLAGS" + LIBS="$OLDLIBS -lgdbm"; + AC_DEFINE(HAVE_GDBM, 1, [GDBM Support]) +--- a/hcache.c ++++ b/hcache.c +@@ -22,7 +22,11 @@ + #include "config.h" + #endif /* HAVE_CONFIG_H */ + +-#if HAVE_GDBM ++#if HAVE_QDBM ++#include <depot.h> ++#include <cabin.h> ++#include <villa.h> ++#elif HAVE_GDBM + #include <gdbm.h> + #elif HAVE_DB4 + #include <db.h> +@@ -42,7 +46,14 @@ + #include "lib.h" + #include "md5.h" + +-#if HAVE_GDBM ++#if HAVE_QDBM ++static struct header_cache ++{ ++ VILLA *db; ++ char *folder; ++ unsigned int crc; ++} HEADER_CACHE; ++#elif HAVE_GDBM + static struct header_cache + { + GDBM_FILE db; +@@ -615,7 +626,139 @@ + return h; } -+#if USE_HCACHE -+static size_t maildir_hcache_keylen (const char *fn) +-#if HAVE_GDBM ++#if HAVE_QDBM ++void * ++mutt_hcache_open(const char *path, const char *folder) +{ -+ const char * p = strrchr (fn, ':'); -+ return p ? (size_t) (p - fn) : mutt_strlen(fn); -+} -+#endif ++ struct header_cache *h = safe_calloc(1, sizeof (HEADER_CACHE)); ++ int flags = 0; ++#if 0 /* FIXME */ ++ int pagesize = atoi(HeaderCachePageSize) ? atoi(HeaderCachePageSize) : 16384; ++#endif ++ h->db = NULL; ++ h->folder = safe_strdup(folder); ++ h->crc = generate_crc32(); + - #ifdef USE_INODESORT - /* - * Merge two maildir lists according to the inode numbers. -@@ -886,27 +894,67 @@ - * This function does the second parsing pass for a maildir-style - * folder. - */ -- - void maildir_delayed_parsing (CONTEXT * ctx, struct maildir *md) - { - struct maildir *p; - char fn[_POSIX_PATH_MAX]; - int count; - -+#if USE_HCACHE -+ void *hc = NULL; -+ void *data; -+ struct timeval *when = NULL; -+ struct stat lastchanged; -+ int ret; ++ if (!path || path[0] == '\0') ++ { ++ FREE(&h->folder); ++ FREE(&h); ++ return NULL; ++ } + -+ hc = mutt_hcache_open (HeaderCache, ctx->path); -+#endif ++ path = mutt_hcache_per_folder(path, folder); + - for (p = md, count = 0; p; p = p->next, count++) -- if (p && p->h && !p->header_parsed) -- { -- if (!ctx->quiet && ReadInc && ((count % ReadInc) == 0 || count == 1)) -- mutt_message (_("Reading %s... %d"), ctx->path, count); -- snprintf (fn, sizeof (fn), "%s/%s", ctx->path, p->h->path); -- if (maildir_parse_message (ctx->magic, fn, p->h->old, p->h)) -- p->header_parsed = 1; -- else -- mutt_free_header (&p->h); -- } --} ++ if (option(OPTHCACHECOMPRESS)) ++ flags = VL_OZCOMP; ++ ++ h->db = vlopen(path, flags | VL_OWRITER | VL_OCREAT, VL_CMPLEX); ++ if (h->db) ++ return h; ++ ++ /* if rw failed try ro */ ++ h->db = vlopen(path, flags | VL_OREADER, 0); ++ if (h->db) ++ return h; ++ else + { -+ if (! (p && p->h && !p->header_parsed)) -+ continue; - -+ if (!ctx->quiet && ReadInc && ((count % ReadInc) == 0 || count == 1)) -+ mutt_message (_("Reading %s... %d"), ctx->path, count); - -+#if USE_HCACHE -+ data = mutt_hcache_fetch (hc, p->h->path + 3, &maildir_hcache_keylen); -+ when = (struct timeval *) data; -+#endif ++ FREE(&h->folder); ++ FREE(&h); ++ ++ return NULL; ++ } ++} + -+ snprintf (fn, sizeof (fn), "%s/%s", ctx->path, p->h->path); ++void ++mutt_hcache_close(void *db) ++{ ++ struct header_cache *h = db; ++ ++ if (!h) ++ return; ++ ++ vlclose(h->db); ++ FREE(&h->folder); ++ FREE(&h); ++} + -+#if USE_HCACHE -+ if (option(OPTHCACHEVERIFY)) -+ ret = stat(fn, &lastchanged); -+ else { -+ lastchanged.st_mtime = 0; -+ ret = 0; ++void * ++mutt_hcache_fetch(void *db, const char *filename, ++ size_t(*keylen) (const char *fn)) ++{ ++ struct header_cache *h = db; ++ char path[_POSIX_PATH_MAX]; ++ int ksize; ++ char *data = NULL; ++ ++ if (!h) ++ return NULL; ++ ++ strncpy(path, h->folder, sizeof (path)); ++ safe_strcat(path, sizeof (path), filename); ++ ++ ksize = strlen(h->folder) + keylen(path + strlen(h->folder)); ++ ++ data = vlget(h->db, path, ksize, NULL); ++ ++ if (! crc32_matches(data, h->crc)) ++ { ++ if (data) { ++ FREE(&data); + } -+ -+ if (data != NULL && !ret && lastchanged.st_mtime <= when->tv_sec) -+ { -+ p->h = mutt_hcache_restore ((unsigned char *)data, &p->h); -+ maildir_parse_flags (p->h, fn); -+ } else -+#endif -+ if (maildir_parse_message (ctx->magic, fn, p->h->old, p->h)) -+ { -+ p->header_parsed = 1; -+#if USE_HCACHE -+ mutt_hcache_store (hc, p->h->path + 3, p->h, 0, &maildir_hcache_keylen); -+#endif -+ } else -+ mutt_free_header (&p->h); -+#if USE_HCACHE -+ FREE(&data); -+#endif ++ return NULL; + } -+#if USE_HCACHE -+ mutt_hcache_close (hc); -+#endif ++ ++ return data; +} ++ ++int ++mutt_hcache_store(void *db, const char *filename, HEADER * header, ++ unsigned long uid_validity, ++ size_t(*keylen) (const char *fn)) ++{ ++ struct header_cache *h = db; ++ char path[_POSIX_PATH_MAX]; ++ int ret; ++ int ksize, dsize; ++ char *data = NULL; ++ ++ if (!h) ++ return -1; ++ ++ strncpy(path, h->folder, sizeof (path)); ++ safe_strcat(path, sizeof (path), filename); ++ ++ ksize = strlen(h->folder) + keylen(path + strlen(h->folder)); ++ ++ data = mutt_hcache_dump(db, header, &dsize, uid_validity); ++ ++ ret = vlput(h->db, path, ksize, data, dsize, VL_DOVER); ++ ++ FREE(&data); ++ ++ return ret; ++} ++ ++int ++mutt_hcache_delete(void *db, const char *filename, ++ size_t(*keylen) (const char *fn)) ++{ ++ struct header_cache *h = db; ++ char path[_POSIX_PATH_MAX]; ++ int ksize; ++ ++ if (!h) ++ return -1; ++ ++ strncpy(path, h->folder, sizeof (path)); ++ safe_strcat(path, sizeof (path), filename); ++ ++ ksize = strlen(h->folder) + keylen(path + strlen(h->folder)); ++ ++ return vlout(h->db, path, ksize); ++} ++ ++#elif HAVE_GDBM - /* Read a MH/maildir style mailbox. - * -@@ -1403,6 +1451,9 @@ - { - char path[_POSIX_PATH_MAX], tmp[_POSIX_PATH_MAX]; - int i, j; -+#if USE_HCACHE -+ void *hc = NULL; -+#endif /* USE_HCACHE */ - - if (ctx->magic == M_MH) - i = mh_check_mailbox (ctx, index_hint); -@@ -1412,6 +1463,11 @@ - if (i != 0) - return i; - -+#if USE_HCACHE -+ if (ctx->magic == M_MAILDIR) -+ hc = mutt_hcache_open(HeaderCache, ctx->path); -+#endif /* USE_HCACHE */ -+ - for (i = 0; i < ctx->msgcount; i++) - { - if (ctx->hdrs[i]->deleted -@@ -1420,7 +1476,13 @@ - snprintf (path, sizeof (path), "%s/%s", ctx->path, ctx->hdrs[i]->path); - if (ctx->magic == M_MAILDIR - || (option (OPTMHPURGE) && ctx->magic == M_MH)) -+ { -+#if USE_HCACHE -+ if (ctx->magic == M_MAILDIR) -+ mutt_hcache_delete (hc, ctx->hdrs[i]->path + 3, &maildir_hcache_keylen); -+#endif /* USE_HCACHE */ - unlink (path); -+ } - else if (ctx->magic == M_MH) - { - /* MH just moves files out of the way when you delete them */ -@@ -1442,16 +1504,21 @@ - if (ctx->magic == M_MAILDIR) - { - if (maildir_sync_message (ctx, i) == -1) -- return -1; -+ goto err; - } - else - { - if (mh_sync_message (ctx, i) == -1) -- return -1; -+ goto err; - } - } - } - -+#if USE_HCACHE -+ if (ctx->magic == M_MAILDIR) -+ mutt_hcache_close (hc); -+#endif /* USE_HCACHE */ -+ - if (ctx->magic == M_MH) - mh_update_sequences (ctx); - -@@ -1472,6 +1539,13 @@ - } - - return 0; -+ -+err: -+#if USE_HCACHE -+ if (ctx->magic == M_MAILDIR) -+ mutt_hcache_close (hc); -+#endif /* USE_HCACHE */ -+ return -1; - } - - static char *maildir_canon_filename (char *dest, const char *src, size_t l) -diff -Nru a/mutt.h b/mutt.h ---- a/mutt.h 2005-02-12 21:19:25 +01:00 -+++ b/mutt.h 2005-02-13 00:51:10 +01:00 -@@ -351,6 +351,9 @@ - OPTFORCENAME, - OPTFORWDECODE, + void * + mutt_hcache_open(const char *path, const char *folder) +--- a/init.h ++++ b/init.h +@@ -1079,6 +1079,15 @@ + ** files when the header cache is in use. This incurs one stat(2) per + ** message every time the folder is opened. + */ ++#if HAVE_QDBM ++ { "header_cache_compress", DT_BOOL, R_NONE, OPTHCACHECOMPRESS, 0 }, ++ /* ++ ** .pp ++ ** If enabled the header cache will be compressed. So only one fifth of the usual ++ ** diskspace is used, but the uncompression can result in a slower open of the ++ ** cached folder. ++ */ ++#endif /* HAVE_QDBM */ + { "header_cache_pagesize", DT_STR, R_NONE, UL &HeaderCachePageSize, UL "16384" }, + /* + ** .pp +--- a/mutt.h ++++ b/mutt.h +@@ -353,6 +353,9 @@ OPTFORWQUOTE, -+#if USE_HCACHE -+ OPTHCACHEVERIFY, -+#endif + #if USE_HCACHE + OPTHCACHEVERIFY, ++#if HAVE_QDBM ++ OPTHCACHECOMPRESS, ++#endif /* HAVE_QDBM */ + #endif OPTHDRS, OPTHEADER, - OPTHELP, diff -ru /usr/ports/mail/mutt-devel/files/extra-patch-nodoc-contrib ./files/extra-patch-nodoc-contrib --- /usr/ports/mail/mutt-devel/files/extra-patch-nodoc-contrib Sat Feb 12 22:11:47 2005 +++ ./files/extra-patch-nodoc-contrib Sun Aug 14 13:01:54 2005 @@ -9,20 +9,20 @@ bin_SCRIPTS = muttbug flea @SMIMEAUX_TARGET@ ---- doc/Makefile.in.orig Fri Feb 4 13:46:04 2005 -+++ doc/Makefile.in Fri Feb 4 13:47:49 2005 -@@ -92,14 +92,6 @@ +--- doc/Makefile.in.orig Sun Aug 14 11:35:31 2005 ++++ doc/Makefile.in Sun Aug 14 11:37:23 2005 +@@ -93,14 +93,6 @@ ./instdoc muttrc.man $(DESTDIR)$(mandir)/man5/muttrc.5 ./instdoc $(srcdir)/mbox.man $(DESTDIR)$(mandir)/man5/mbox.5 ./instdoc $(srcdir)/mmdf.man $(DESTDIR)$(mandir)/man5/mmdf.5 - $(top_srcdir)/mkinstalldirs $(DESTDIR)$(docdir) -- for f in $(srcdir_DOCFILES) ; do \ -- $(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(docdir) ; \ -- done - for f in $(topsrcdir_DOCFILES) ; do \ - $(INSTALL) -m 644 $(top_srcdir)/$$f $(DESTDIR)$(docdir) ; \ - done +- for f in $(srcdir_DOCFILES) ; do \ +- $(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(docdir) ; \ +- done - $(INSTALL) -m 644 manual.txt $(DESTDIR)$(docdir) || true uninstall: - -rm -f $(DESTDIR)$(mandir)/man1/mutt.1 + for f in mutt.1 mutt_dotlock.1 flea.1 muttbug.1 ; do \ diff -ru /usr/ports/mail/mutt-devel/files/extra-patch-sgmlformat ./files/extra-patch-sgmlformat --- /usr/ports/mail/mutt-devel/files/extra-patch-sgmlformat Fri Aug 30 14:32:58 2002 +++ ./files/extra-patch-sgmlformat Sun Aug 14 13:01:54 2005 @@ -5,7 +5,7 @@ README NEWS TODO README.SECURITY README.SSL -all: -+all: muttrc.man try-html try-txt try-latin1 try-ps ++all: mutt.1 muttrc.man try-html try-txt try-latin1 try-ps try-html: ../makedoc rm -f *.html && $(MAKE) manual.html || cp $(srcdir)/manual*.html ./ diff -ru /usr/ports/mail/mutt-devel/files/patch-02 ./files/patch-02 --- /usr/ports/mail/mutt-devel/files/patch-02 Mon Mar 14 12:59:12 2005 +++ ./files/patch-02 Sun Aug 14 13:01:54 2005 @@ -1,34 +1,34 @@ ---- doc/Makefile.in.orig Tue Feb 15 20:28:24 2005 -+++ doc/Makefile.in Mon Mar 14 08:08:25 2005 -@@ -63,13 +63,23 @@ +--- doc/Makefile.in.orig Thu Aug 11 21:37:02 2005 ++++ doc/Makefile.in Sun Aug 14 11:09:10 2005 +@@ -64,13 +64,23 @@ ChangeLog.old \ README NEWS TODO README.SECURITY README.SSL --all: muttrc.man try-html try-txt +-all: mutt.1 muttrc.man try-html try-txt +all: - try-html: ../makedoc + try-html: ../makedoc$(EXEEXT) - test -f manual.html || $(MAKE) manual.html || cp $(srcdir)/manual*.html ./ + rm -f *.html && $(MAKE) manual.html || cp $(srcdir)/manual*.html ./ + touch $@ - try-txt: ../makedoc + try-txt: ../makedoc$(EXEEXT) - test -f manual.txt || $(MAKE) manual.txt || cp $(srcdir)/manual.txt ./ + $(MAKE) manual.txt || cp $(srcdir)/manual.txt ./ + touch $@ + -+try-latin1: ++try-latin1: ../makedoc$(EXEEXT) + $(MAKE) manual.latin1 || cp $(srcdir)/manual.latin1 ./ + touch $@ + -+try-ps: -+ $(MAKE) manual.ps || cp $(srcdir)/manual.ps ./ ++try-ps: ../makedoc$(EXEEXT) ++ $(MAKE) manual.ps || cp $(srcdir)/manual.latin1 ./ + touch $@ install: all instdoc $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man1 -@@ -90,10 +100,6 @@ - $(INSTALL) -m 644 $(top_srcdir)/$$f $(DESTDIR)$(docdir) ; \ +@@ -91,10 +101,6 @@ + $(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(docdir) ; \ done $(INSTALL) -m 644 manual.txt $(DESTDIR)$(docdir) || true - $(top_srcdir)/mkinstalldirs $(DESTDIR)$(docdir)/html @@ -37,12 +37,12 @@ - done uninstall: - -rm -f $(DESTDIR)$(mandir)/man1/mutt.1 -@@ -103,17 +109,20 @@ + for f in mutt.1 mutt_dotlock.1 flea.1 muttbug.1 ; do \ +@@ -114,17 +120,20 @@ check: manual.txt: manual.sgml -- if linuxdoc -B txt --pass='-P -c' manual ; then \ +- if linuxdoc -B txt -c latin --pass='-P -c' manual ; then \ - uniq < manual.txt | expand > _manual.txt ; \ - rm manual.txt ; \ + if sgmlfmt -f ascii manual; then \ diff -ru /usr/ports/mail/mutt-devel/files/patch-doc-mutt.1 ./files/patch-doc-mutt.1 --- /usr/ports/mail/mutt-devel/files/patch-doc-mutt.1 Thu Jan 1 01:00:00 1970 +++ ./files/patch-doc-mutt.1 Sun Aug 14 13:01:18 2005 @@ -0,0 +1,11 @@ +--- doc/Makefile.in.orig Sun Aug 14 11:27:21 2005 ++++ doc/Makefile.in Sun Aug 14 11:28:38 2005 +@@ -179,7 +179,7 @@ + -e 's,@docdir\@,$(docdir),g' + + mutt.1: $(srcdir)/mutt.man +- $(EDIT) $< > $@ ++ $(EDIT) $(srcdir)/mutt.man > $@ + + muttrc.man stamp-doc-man: ../makedoc$(EXEEXT) $(top_srcdir)/init.h muttrc.man.head muttrc.man.tail + $(MAKEDOC_CPP) $(top_srcdir)/init.h | ../makedoc -m | \ diff -ru /usr/ports/mail/mutt-devel/files/patch-doc-mutt.man ./files/patch-doc-mutt.man --- /usr/ports/mail/mutt-devel/files/patch-doc-mutt.man Sun Oct 26 14:14:24 2003 +++ ./files/patch-doc-mutt.man Sun Aug 14 13:01:54 2005 @@ -1,17 +1,3 @@ ---- doc/mutt.man.orig Wed Nov 13 11:07:05 2002 -+++ doc/mutt.man Wed Sep 24 15:36:17 2003 -@@ -148,9 +148,9 @@ - User's personal mapping between MIME types and file extensions. - .IP "/etc/mime.types" - System mapping between MIME types and file extensions. --.IP "/usr/local/bin/mutt_dotlock" -+.IP "${PREFIX}/bin/mutt_dotlock" - The privileged dotlocking program. --.IP "/usr/local/doc/mutt/manual.txt" -+.IP "${DOCSDIR}/manual.txt" - The Mutt manual. - .SH BUGS - .PP --- doc/muttrc.man.orig Wed Mar 19 22:55:03 2003 +++ doc/muttrc.man Sun Oct 26 11:16:05 2003 @@ -1031,7 +1031,7 @@ diff -ru /usr/ports/mail/mutt-devel/scripts/generate-plist ./scripts/generate-plist --- /usr/ports/mail/mutt-devel/scripts/generate-plist Mon Jul 4 04:49:05 2005 +++ ./scripts/generate-plist Sun Aug 14 13:01:54 2005 @@ -126,7 +126,7 @@ fi if [ "$MUTT_HTML" = "yes" ]; then - html=383 + html=395 if [ "$MUTT_COMPRESSED_FOLDERS" = "yes" ]; then html=$(($html + 5)) fi @@ -136,15 +136,6 @@ if [ "$MUTT_QUOTE_PATCH" = "yes" ]; then html=$(($html + 2)) fi - if [ "$MUTT_EDIT_THREADS" = "yes" ]; then - html=$(($html + 3)) - fi - if [ "$MUTT_IMAP_HEADER_CACHE" = "yes" ]; then - html=$(($html + 2)) - fi - if [ "$MUTT_MAILDIR_HEADER_CACHE" = "yes" ]; then - html=$(($html + 1)) - fi if [ "$MUTT_SIDEBAR_PATCH" = "yes" ]; then html=$(($html + 2)) fi @@ -152,9 +143,6 @@ html=$(($html + 1)) fi if [ "$MUTT_IFDEF_PATCH" = "yes" ]; then - html=$(($html + 1)) - fi - if [ "$MUTT_IDN" = "yes" ]; then html=$(($html + 1)) fi if [ "$MUTT_REVERSE_REPLY_PATCH" = "yes" ]; then
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Just to mention that http://thomer.com/mutt/patch-1.5.10i.sidebar.20050816.txt is out and "WITH_MUTT_SIDEBAR_PATCH does not work at the moment" can be removed. -----BEGIN PGP SIGNATURE----- iD8DBQFDAxv4Fw6SP/bBpCARApufAKCA2Axcw4caM/LSIIirZTwYVkjVXwCfa27v bypYy3unTgxaUMvtF9n0MZ0= =a5a1 -----END PGP SIGNATURE-----
Sorry for my previous mail, I just didn't see your reply: "OK, here's an updated patch...", as it did not came to freebsd-ports-bugs@
An another update. Sorry for that, but I just discovered a problem with the slave port "mutt-devel-lite". Also a file can be deleted from the tree (files/extra-patch-edit-threads as the edit-threads functions are now part of the mutt sources) Thus: Maintainer update of mail/mutt-devel: - Update to mutt-1.5.10 - Update the maildir header cache patch - Change the target when extra-patches are applied from pre-configure to post-patch, so users with local patches can apply them after a "make patch" and then already applied extra-patches. Committer: cvs rm files/extra-patch-edit-threads; cvs add files/patch-doc-mutt.1 Best regards Udo diff -ru /usr/ports/mail/mutt-devel/Makefile ./Makefile --- /usr/ports/mail/mutt-devel/Makefile Mon Jul 4 04:49:05 2005 +++ ./Makefile Tue Aug 16 17:33:35 2005 @@ -71,9 +71,6 @@ # If you want mutt to use the ispell spelling checker define: # WITH_MUTT_ISPELL # -# If you want to use the rethreading functions define: -# WITH_MUTT_EDIT_THREADS -# # If you want to use the signature menu define: # WITH_MUTT_SIGNATURE_MENU # @@ -98,8 +95,8 @@ # PORTNAME= mutt-devel -PORTVERSION= 1.5.9 -PORTREVISION= 3 +PORTVERSION= 1.5.10 +PORTREVISION= 0 CATEGORIES+= mail ipv6 .if defined(WITH_MUTT_NNTP) CATEGORIES+= news @@ -282,15 +279,15 @@ LIB_DEPENDS+= idn:${PORTSDIR}/devel/libidn .endif .if ! defined(WITHOUT_MUTT_SMIME_OUTLOOK_COMPAT) -pre-configure:: +post-patch:: @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-smime-outlook .endif .if defined(WITH_MUTT_MAILDIR_HEADER_CACHE) -pre-configure:: +post-patch:: @${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-maildir-header-cache .endif .if defined(WITH_MUTT_MAILDIR_MTIME_PATCH) -pre-configure:: +post-patch:: .if defined(WITH_MUTT_NNTP) @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-maildir-mtime-nntp .else @@ -298,23 +295,18 @@ .endif .endif -.if defined(WITH_MUTT_EDIT_THREADS) -pre-configure:: - @${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-edit-threads -.endif - .if defined(WITH_MUTT_SIDEBAR_PATCH) -pre-configure:: +post-patch:: @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-sidebar .endif .if defined(WITH_MUTT_ASPELL) -pre-configure:: +post-patch:: @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-aspell .endif .if defined(WITH_MUTT_REVERSE_REPLY_PATCH) -pre-configure:: +post-patch:: @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-reverse_reply .endif @@ -375,10 +367,6 @@ patch-${VVV_PATCH_VERSION}.vvv.quote.gz:vvv SGML_NEEDED= yes .endif -.if defined(WITH_MUTT_EDIT_THREADS) -CONFIGURE_ARGS+= --enable-imap-edit-threads -SGML_NEEDED= yes -.endif .if defined(WITH_MUTT_SIGNATURE_MENU) PATCHFILES+= patch-${CD_PATCH_VERSION}.cd.signatures_menu.2.1:cd SGML_NEEDED= yes @@ -391,7 +379,7 @@ PATCHFILES+= p0-patch-${DW_MBOX_PATCH_VERSION}.dw.mbox-hook.1:dw .endif .if defined(WITH_MUTT_SIDEBAR_PATCH) -SIDEBAR_PATCH= patch-1.5.9i.sidebar.20050628.txt +SIDEBAR_PATCH= patch-1.5.10i.sidebar.20050816.txt DISTFILES+= $(SIDEBAR_PATCH):thomer SGML_NEEDED= yes pre-patch:: @@ -429,19 +417,16 @@ SCRIPTS_ENV+= MUTT_QUOTE_PATCH="yes" .endif .if defined(WITH_MUTT_IMAP_HEADER_CACHE) -SCRIPTS_ENV+= MUTT_IMAP_HEADER_CACHE="yes" CONFIGURE_ARGS+= --enable-hcache --without-gdbm --with-bdb +.else +CONFIGURE_ARGS+= --disable-hcache .endif .if defined(WITH_MUTT_MAILDIR_HEADER_CACHE) -SCRIPTS_ENV+= MUTT_MAILDIR_HEADER_CACHE="yes" -CONFIGURE_ARGS+= --disable-inodesort +CONFIGURE_ARGS+= --disable-inodesort --without-qdbm .endif .if defined(WITH_MUTT_SIDEBAR_PATCH) SCRIPTS_ENV+= MUTT_SIDEBAR_PATCH="yes" .endif -.if defined(WITH_MUTT_EDIT_THREADS) -SCRIPTS_ENV+= MUTT_EDIT_THREADS="yes" -.endif .if defined(WITH_MUTT_SIGNATURE_MENU) SCRIPTS_ENV+= MUTT_SIGNATURE_MENU="yes" .endif @@ -453,9 +438,6 @@ .endif .if !defined(WITHOUT_NLS) SCRIPTS_ENV+= MUTT_NLS="yes" -.endif -.if defined(WITH_MUTT_IDN) -SCRIPTS_ENV+= MUTT_IDN="yes" .endif .if defined(WITH_MUTT_REVERSE_REPLY_PATCH) SCRIPTS_ENV+= MUTT_REVERSE_REPLY_PATCH="yes" diff -ru /usr/ports/mail/mutt-devel/distinfo ./distinfo --- /usr/ports/mail/mutt-devel/distinfo Mon Jul 4 04:49:05 2005 +++ ./distinfo Tue Aug 16 17:33:35 2005 @@ -1,16 +1,16 @@ -MD5 (mutt/mutt-1.5.9i.tar.gz) = c5318eba3404ebd78a15c680fa1b6056 -SIZE (mutt/mutt-1.5.9i.tar.gz) = 3036003 -MD5 (mutt/patch-1.5.9.rr.compressed.gz) = 9d9ef4ec0e970f9fc3de2d5c6219a349 -SIZE (mutt/patch-1.5.9.rr.compressed.gz) = 10260 -MD5 (mutt/patch-1.5.9.vvv.nntp.gz) = f7cf37af82169eefe94c6c42c6f3b9cd -SIZE (mutt/patch-1.5.9.vvv.nntp.gz) = 91518 -MD5 (mutt/patch-1.5.9.vvv.initials.gz) = 149c52991b23b9ab3d6add27cb27e151 -SIZE (mutt/patch-1.5.9.vvv.initials.gz) = 689 -MD5 (mutt/patch-1.5.9.vvv.quote.gz) = 08329134d8995c05a28dd8258174a668 -SIZE (mutt/patch-1.5.9.vvv.quote.gz) = 1629 +MD5 (mutt/mutt-1.5.10i.tar.gz) = 59400d12c6b5b3d122531000e53d1914 +SIZE (mutt/mutt-1.5.10i.tar.gz) = 3156345 +MD5 (mutt/patch-1.5.10.rr.compressed.gz) = f6cd5bd6c030d5d691d347a6e9d75b6a +SIZE (mutt/patch-1.5.10.rr.compressed.gz) = 10095 +MD5 (mutt/patch-1.5.10.vvv.nntp.gz) = ac9a4c8bf25a96648bb08cde4ced4c05 +SIZE (mutt/patch-1.5.10.vvv.nntp.gz) = 98153 +MD5 (mutt/patch-1.5.10.vvv.initials.gz) = 91eea7344625830bf4231dc1d56cb799 +SIZE (mutt/patch-1.5.10.vvv.initials.gz) = 682 +MD5 (mutt/patch-1.5.10.vvv.quote.gz) = 7d9b9c2d52318782d81d2ffb95576d48 +SIZE (mutt/patch-1.5.10.vvv.quote.gz) = 1580 MD5 (mutt/patch-1.5.4.cd.ifdef.1) = a545036cdb55519154d0b35465f52daa SIZE (mutt/patch-1.5.4.cd.ifdef.1) = 3545 MD5 (mutt/p0-patch-1.5.6.dw.mbox-hook.1) = 9e29a6778ab07a4de3442691e4573fea SIZE (mutt/p0-patch-1.5.6.dw.mbox-hook.1) = 6405 -MD5 (mutt/patch-1.5.9i.sidebar.20050628.txt) = da1311e36e74e58037de7d231983fd47 -SIZE (mutt/patch-1.5.9i.sidebar.20050628.txt) = 46571 +MD5 (mutt/patch-1.5.10i.sidebar.20050816.txt) = da7f5094a408369992008cf0f951774d +SIZE (mutt/patch-1.5.10i.sidebar.20050816.txt) = 47544 diff -ru /usr/ports/mail/mutt-devel/files/extra-patch-edit-threads ./files/extra-patch-edit-threads --- /usr/ports/mail/mutt-devel/files/extra-patch-edit-threads Mon Mar 14 12:59:12 2005 +++ ./files/extra-patch-edit-threads Thu Jan 1 01:00:00 1970 @@ -1,604 +0,0 @@ -diff -Nru a/PATCHES b/PATCHES ---- a/PATCHES -+++ b/PATCHES -@@ -0,0 +1 @@ -+patch-1.5.7.tg.edit_threads.1 -diff -Nru a/OPS b/OPS ---- a/OPS 2005-01-29 17:07:15 +01:00 -+++ b/OPS 2005-01-29 17:07:15 +01:00 -@@ -96,6 +96,7 @@ - OP_LIST_REPLY "reply to specified mailing list" - OP_MACRO "execute a macro" - OP_MAIL "compose a new mail message" -+OP_MAIN_BREAK_THREAD "break the thread in two" - OP_MAIN_CHANGE_FOLDER "open a different folder" - OP_MAIN_CHANGE_FOLDER_READONLY "open a different folder in read only mode" - OP_MAIN_CLEAR_FLAG "clear a status flag from a message" -@@ -105,6 +106,7 @@ - OP_MAIN_FIRST_MESSAGE "move to the first message" - OP_MAIN_LAST_MESSAGE "move to the last message" - OP_MAIN_LIMIT "show only messages matching a pattern" -+OP_MAIN_LINK_THREADS "link tagged message to the current one" - OP_MAIN_NEXT_NEW "jump to the next new message" - OP_MAIN_NEXT_NEW_THEN_UNREAD "jump to the next new or unread message" - OP_MAIN_NEXT_SUBTHREAD "jump to the next subthread" ---- /dev/null Sun Feb 13 11:16:10 2005 -+++ b/acconfig.h Sun Feb 13 11:15:44 2005 -@@ -0,0 +1,4 @@ -+/* Do you want to use the rethreading functions with IMAP -+ * (--enable-imap-edit-threads) */ -+#undef IMAP_EDIT_THREADS -+ -diff -Nru a/configure.in b/configure.in ---- a/configure.in.orig Mon Mar 14 08:30:21 2005 -+++ b/configure.in Mon Mar 14 08:33:05 2005 -@@ -566,6 +566,16 @@ - AM_CONDITIONAL(USE_GSS, test x$need_gss = xyes) - - dnl -- end imap dependencies -- -+ -+AC_ARG_ENABLE(imap-edit-threads, [ --enable-imap-edit-threads Enable editing threads support for IMAP], -+[ -+ if test "$enableval" = "yes"; then -+ if test "$need_imap" = "yes"; then -+ AC_DEFINE(IMAP_EDIT_THREADS) -+ else -+ AC_MSG_WARN([IMAP support for edit_threads is only useful with IMAP support]) -+ fi -+fi]) - - AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl[=PFX]], [Compile in SSL support for POP/IMAP]), - [ if test "$with_ssl" != "no" -diff -Nru a/copy.c b/copy.c ---- a/copy.c 2005-01-29 17:07:15 +01:00 -+++ b/copy.c 2005-01-29 17:07:15 +01:00 -@@ -95,6 +95,12 @@ - (ascii_strncasecmp ("Content-Length:", buf, 15) == 0 || - ascii_strncasecmp ("Lines:", buf, 6) == 0)) - continue; -+ if ((flags & CH_UPDATE_REFS) && -+ ascii_strncasecmp ("References:", buf, 11) == 0) -+ continue; -+ if ((flags & CH_UPDATE_IRT) && -+ ascii_strncasecmp ("In-Reply-To:", buf, 12) == 0) -+ continue; - ignore = 0; - } - -@@ -193,6 +199,12 @@ - ascii_strncasecmp ("type:", buf + 8, 5) == 0)) || - ascii_strncasecmp ("mime-version:", buf, 13) == 0)) - continue; -+ if ((flags & CH_UPDATE_REFS) && -+ ascii_strncasecmp ("References:", buf, 11) == 0) -+ continue; -+ if ((flags & CH_UPDATE_IRT) && -+ ascii_strncasecmp ("In-Reply-To:", buf, 12) == 0) -+ continue; - - /* Find x -- the array entry where this header is to be saved */ - if (flags & CH_REORDER) -@@ -326,6 +338,8 @@ - CH_XMIT ignore Lines: and Content-Length: - CH_WEED do header weeding - CH_NOQFROM ignore ">From " line -+ CH_UPDATE_IRT update the In-Reply-To: header -+ CH_UPDATE_REFS update the References: header - - prefix - string to use if CH_PREFIX is set -@@ -335,6 +349,9 @@ - mutt_copy_header (FILE *in, HEADER *h, FILE *out, int flags, const char *prefix) - { - char buffer[SHORT_STRING]; -+ -+ flags |= (h->irt_changed ? CH_UPDATE_IRT : 0) -+ | (h->refs_changed ? CH_UPDATE_REFS : 0); - - if (mutt_copy_hdr (in, out, h->offset, h->content->offset, flags, prefix) == -1) - return (-1); -@@ -358,7 +375,56 @@ - if (flags & CH_UPDATE) - { - if ((flags & CH_NOSTATUS) == 0) -+#ifdef IMAP_EDIT_THREADS -+#define NEW_ENV new_env -+#else -+#define NEW_ENV env -+#endif - { -+ if (h->irt_changed && h->NEW_ENV->in_reply_to) -+ { -+ LIST *listp = h->NEW_ENV->in_reply_to; -+ -+ if (fputs ("In-Reply-To: ", out) == EOF) -+ return (-1); -+ -+ for (; listp; listp = listp->next) -+ if ((fputs (listp->data, out) == EOF) || (fputc (' ', out) == EOF)) -+ return (-1); -+ -+ if (fputc ('\n', out) == EOF) -+ return (-1); -+ } -+ -+ if (h->refs_changed && h->NEW_ENV->references) -+ { -+ LIST *listp = h->NEW_ENV->references, *refs = NULL, *t; -+ -+ if (fputs ("References: ", out) == EOF) -+ return (-1); -+ -+ /* Mutt stores references in reverse order, thus we create -+ * a reordered refs list that we can put in the headers */ -+ for (; listp; listp = listp->next, refs = t) -+ { -+ t = (LIST *)safe_malloc (sizeof (LIST)); -+ t->data = listp->data; -+ t->next = refs; -+ } -+ -+ for (; refs; refs = refs->next) -+ if ((fputs (refs->data, out) == EOF) || (fputc (' ', out) == EOF)) -+ return (-1); -+ -+ /* clearing refs from memory */ -+ for (t = refs; refs; refs = t->next, t = refs) -+ safe_free ((void **)&refs); -+ -+ if (fputc ('\n', out) == EOF) -+ return (-1); -+ } -+#undef NEW_ENV -+ - if (h->old || h->read) - { - if (fputs ("Status: ", out) == EOF) -diff -Nru a/curs_main.c b/curs_main.c ---- a/curs_main.c 2005-01-29 17:07:15 +01:00 -+++ b/curs_main.c 2005-01-29 17:07:15 +01:00 -@@ -930,6 +930,11 @@ - else - { - mutt_set_flag (Context, CURHDR, M_TAG, !CURHDR->tagged); -+ -+ Context->last_tag = CURHDR->tagged ? CURHDR : -+ ((Context->last_tag == CURHDR && !CURHDR->tagged) -+ ? NULL : Context->last_tag); -+ - menu->redraw = REDRAW_STATUS; - if (option (OPTRESOLVE) && menu->current < Context->vcount - 1) - { -@@ -1165,6 +1170,89 @@ - } - done = 1; - } -+ break; -+ -+ case OP_MAIN_BREAK_THREAD: -+ -+ CHECK_MSGCOUNT; -+ CHECK_VISIBLE; -+ CHECK_READONLY; -+ -+ if ((Sort & SORT_MASK) != SORT_THREADS) -+ mutt_error _("Threading is not enabled."); -+ -+#if defined (USE_IMAP) && ! defined (IMAP_EDIT_THREADS) -+ else if (Context->magic == M_IMAP) -+ mutt_error _("Compile Mutt with --enable-imap-edit-threads for break-thread support"); -+#endif -+ -+ else -+ { -+ { -+ HEADER *oldcur = CURHDR; -+ -+ mutt_break_thread (CURHDR); -+ mutt_sort_headers (Context, 1); -+ menu->current = oldcur->virtual; -+ } -+ -+ Context->changed = 1; -+ mutt_message _("Thread broken"); -+ -+ if (menu->menu == MENU_PAGER) -+ { -+ op = OP_DISPLAY_MESSAGE; -+ continue; -+ } -+ else -+ menu->redraw |= REDRAW_INDEX; -+ } -+ -+ break; -+ -+ case OP_MAIN_LINK_THREADS: -+ -+ CHECK_MSGCOUNT; -+ CHECK_VISIBLE; -+ CHECK_READONLY; -+ -+ if ((Sort & SORT_MASK) != SORT_THREADS) -+ mutt_error _("Threading is not enabled."); -+ -+#if defined (USE_IMAP) && ! defined (IMAP_EDIT_THREADS) -+ else if (Context->magic == M_IMAP) -+ mutt_error _("Compile Mutt with --enable-imap-edit-threads for link-threads support"); -+#endif -+ -+ else if (!CURHDR->env->message_id) -+ mutt_error _("No Message-ID: header available to link thread"); -+ else if (!tag && (!Context->last_tag || !Context->last_tag->tagged)) -+ mutt_error _("First, please tag a message to be linked here"); -+ else -+ { -+ HEADER *oldcur = CURHDR; -+ -+ if (mutt_link_threads (CURHDR, tag ? NULL : Context->last_tag, -+ Context)) -+ { -+ mutt_sort_headers (Context, 1); -+ menu->current = oldcur->virtual; -+ -+ Context->changed = 1; -+ mutt_message _("Threads linked"); -+ } -+ else -+ mutt_error _("No thread linked"); -+ } -+ -+ if (menu->menu == MENU_PAGER) -+ { -+ op = OP_DISPLAY_MESSAGE; -+ continue; -+ } -+ else -+ menu->redraw |= REDRAW_STATUS | REDRAW_INDEX; -+ - break; - - case OP_EDIT_TYPE: -diff -Nru a/doc/manual.sgml.head b/doc/manual.sgml.head ---- a/doc/manual.sgml.head 2005-01-29 17:07:15 +01:00 -+++ b/doc/manual.sgml.head 2005-01-29 17:07:15 +01:00 -@@ -2322,8 +2322,43 @@ - with large volume mailing lists easier because you can easily delete - uninteresting threads and quickly find topics of value. - -+<sect1>Editing threads -+<p> -+Mutt has the ability to dynamically restructure threads that are broken -+either by misconfigured software or bad behaviour from some -+correspondents. This allows to clean your mailboxes formats) from these -+annoyances which make it hard to follow a discussion. -+ -+If you want to use these functions with IMAP, you need to compile Mutt -+with the <em/--enable-imap-edit-threads/ configure flag. -+ -+<sect2>Linking threads -+<p> -+ -+Some mailers tend to "forget" to correctly set the "In-Reply-To:" and -+"References:" headers when replying to a message. This results in broken -+discussions because Mutt has not enough information to guess the correct -+threading. -+You can fix this by tagging the reply, then moving to the parent message -+and using the ``link-threads'' function (bound to & by default). The -+reply will then be connected to this "parent" message. -+ -+You can also connect multiple childs at once, tagging them and using the -+tag-prefix command (';') or the auto_tag option. -+ -+<sect2>Breaking threads -+<p> -+ -+On mailing lists, some people are in the bad habit of starting a new -+discussion by hitting "reply" to any message from the list and changing -+the subject to a totally unrelated one. -+You can fix such threads by using the ``break-thread'' function (bound -+by default to #), which will turn the subthread starting from the -+current message into a whole different thread. -+ - <sect1>Delivery Status Notification (DSN) Support - <p> -+ - RFC1894 defines a set of MIME content types for relaying information - about the status of electronic mail messages. These can be thought of as - ``return receipts.'' Berkeley sendmail 8.8.x currently has some command -diff -Nru a/functions.h b/functions.h ---- a/functions.h 2005-01-29 17:07:15 +01:00 -+++ b/functions.h 2005-01-29 17:07:15 +01:00 -@@ -69,6 +69,7 @@ - struct binding_t OpMain[] = { - { "create-alias", OP_CREATE_ALIAS, "a" }, - { "bounce-message", OP_BOUNCE_MESSAGE, "b" }, -+ { "break-thread", OP_MAIN_BREAK_THREAD, "#" }, - { "change-folder", OP_MAIN_CHANGE_FOLDER, "c" }, - { "change-folder-readonly", OP_MAIN_CHANGE_FOLDER_READONLY, "\033c" }, - { "collapse-thread", OP_MAIN_COLLAPSE_THREAD, "\033v" }, -@@ -95,6 +96,7 @@ - { "next-undeleted", OP_MAIN_NEXT_UNDELETED, "j" }, - { "previous-undeleted", OP_MAIN_PREV_UNDELETED, "k" }, - { "limit", OP_MAIN_LIMIT, "l" }, -+ { "link-threads", OP_MAIN_LINK_THREADS, "&" }, - { "list-reply", OP_LIST_REPLY, "L" }, - { "mail", OP_MAIL, "m" }, - { "toggle-new", OP_TOGGLE_NEW, "N" }, -@@ -153,6 +155,7 @@ - }; - - struct binding_t OpPager[] = { -+ { "break-thread", OP_MAIN_BREAK_THREAD, "#" }, - { "create-alias", OP_CREATE_ALIAS, "a" }, - { "bounce-message", OP_BOUNCE_MESSAGE, "b" }, - { "change-folder", OP_MAIN_CHANGE_FOLDER, "c" }, -@@ -175,6 +178,7 @@ - { "next-entry", OP_NEXT_ENTRY, "J" }, - { "previous-undeleted",OP_MAIN_PREV_UNDELETED, "k" }, - { "previous-entry", OP_PREV_ENTRY, "K" }, -+ { "link-threads", OP_MAIN_LINK_THREADS, "&" }, - { "list-reply", OP_LIST_REPLY, "L" }, - { "redraw-screen", OP_REDRAW, "\014" }, - { "mail", OP_MAIL, "m" }, -diff -Nru a/imap/imap.c b/imap/imap.c ---- a/imap/imap.c 2005-01-29 17:07:15 +01:00 -+++ b/imap/imap.c 2005-01-29 17:07:15 +01:00 -@@ -983,9 +983,11 @@ - mutt_buffer_addstr (&cmd, "UID STORE "); - mutt_buffer_addstr (&cmd, uid); - -- /* if attachments have been deleted we delete the message and reupload -- * it. This works better if we're expunging, of course. */ -- if (ctx->hdrs[n]->attach_del) -+ /* if the message has been rethreaded or attachments have been deleted -+ * we delete the message and reupload it. -+ * This works better if we're expunging, of course. */ -+ if (ctx->hdrs[n]->refs_changed || ctx->hdrs[n]->irt_changed || -+ ctx->hdrs[n]->attach_del) - { - dprint (3, (debugfile, "imap_sync_mailbox: Attachments to be deleted, falling back to _mutt_save_message\n")); - if (!appendctx) -diff -Nru a/main.c b/main.c ---- a/main.c 2005-01-29 17:07:15 +01:00 -+++ b/main.c 2005-01-29 17:07:15 +01:00 -@@ -235,6 +235,12 @@ - "-USE_IMAP " - #endif - -+#ifdef IMAP_EDIT_THREADS -+ "+IMAP_EDIT_THREADS " -+#else -+ "-IMAP_EDIT_THREADS " -+#endif -+ - #ifdef USE_GSS - "+USE_GSS " - #else -diff -Nru a/mh.c b/mh.c ---- a/mh.c 2005-01-29 17:07:15 +01:00 -+++ b/mh.c 2005-01-29 17:07:15 +01:00 -@@ -1326,7 +1326,7 @@ - { - HEADER *h = ctx->hdrs[msgno]; - -- if (h->attach_del) -+ if (h->attach_del || h->refs_changed || h->irt_changed) - if (mh_rewrite_message (ctx, msgno) != 0) - return -1; - -@@ -1337,9 +1337,9 @@ - { - HEADER *h = ctx->hdrs[msgno]; - -- if (h->attach_del) -+ if (h->attach_del || h->refs_changed || h->irt_changed) - { -- /* when doing attachment deletion, fall back to the MH case. */ -+ /* when doing attachment deletion/rethreading, fall back to the MH case. */ - if (mh_rewrite_message (ctx, msgno) != 0) - return (-1); - } -diff -Nru a/mutt.h b/mutt.h ---- a/mutt.h 2005-01-29 17:07:15 +01:00 -+++ b/mutt.h 2005-01-29 17:07:15 +01:00 -@@ -96,6 +96,8 @@ - #define CH_WEED_DELIVERED (1<<13) /* weed eventual Delivered-To headers */ - #define CH_FORCE_FROM (1<<14) /* give CH_FROM precedence over CH_WEED? */ - #define CH_NOQFROM (1<<15) /* give CH_FROM precedence over CH_WEED? */ -+#define CH_UPDATE_IRT (1<<16) /* update In-Reply-To: */ -+#define CH_UPDATE_REFS (1<<17) /* update References: */ - - /* flags for mutt_enter_string() */ - #define M_ALIAS 1 /* do alias "completion" by calling up the alias-menu */ -@@ -542,6 +544,7 @@ - #define mutt_new_rx_list() safe_calloc (1, sizeof (RX_LIST)) - #define mutt_new_spam_list() safe_calloc (1, sizeof (SPAM_LIST)) - void mutt_free_list (LIST **); -+LIST *mutt_copy_list (LIST *); - void mutt_free_rx_list (RX_LIST **); - void mutt_free_spam_list (SPAM_LIST **); - int mutt_matches_ignore (const char *, LIST *); -@@ -699,6 +702,8 @@ - unsigned int subject_changed : 1; /* used for threading */ - unsigned int threaded : 1; /* used for threading */ - unsigned int display_subject : 1; /* used for threading */ -+ unsigned int irt_changed : 1; /* In-Reply-To changed to link/break threads */ -+ unsigned int refs_changed : 1; /* References changed to break thread */ - unsigned int recip_valid : 1; /* is_recipient is valid */ - unsigned int active : 1; /* message is not to be removed */ - unsigned int trash : 1; /* message is marked as trashed on disk. -@@ -739,6 +744,10 @@ - char *tree; /* character string to print thread tree */ - struct thread *thread; - -+#ifdef IMAP_EDIT_THREADS -+ ENVELOPE *new_env; /* envelope information for rethreading */ -+#endif -+ - #ifdef MIXMASTER - LIST *chain; - #endif -@@ -803,6 +812,7 @@ - char *pattern; /* limit pattern string */ - pattern_t *limit_pattern; /* compiled limit pattern */ - HEADER **hdrs; -+ HEADER *last_tag; /* last tagged msg. used to link threads */ - THREAD *tree; /* top of thread tree */ - HASH *id_hash; /* hash table by msg id */ - HASH *subj_hash; /* hash table by subject */ -diff -Nru a/mx.c b/mx.c ---- a/mx.c 2005-01-29 17:07:15 +01:00 -+++ b/mx.c 2005-01-29 17:07:15 +01:00 -@@ -1161,6 +1161,8 @@ - ctx->deleted = 0; - } - } -+ else if (ctx->last_tag && ctx->last_tag->deleted) -+ ctx->last_tag = NULL; /* reset last tagged msg now useless */ - } - - /* really only for IMAP - imap_sync_mailbox results in a call to -diff -Nru a/pager.c b/pager.c ---- a/pager.c 2005-01-29 17:07:15 +01:00 -+++ b/pager.c 2005-01-29 17:07:15 +01:00 -@@ -2492,6 +2492,11 @@ - case OP_TAG: - CHECK_MODE(IsHeader (extra)); - mutt_set_flag (Context, extra->hdr, M_TAG, !extra->hdr->tagged); -+ -+ Context->last_tag = extra->hdr->tagged ? extra->hdr : -+ ((Context->last_tag == extra->hdr && !extra->hdr->tagged) -+ ? NULL : Context->last_tag); -+ - redraw = REDRAW_STATUS | REDRAW_INDEX; - if (option (OPTRESOLVE)) - { -diff -Nru a/protos.h b/protos.h ---- a/protos.h 2005-01-29 17:07:15 +01:00 -+++ b/protos.h 2005-01-29 17:07:15 +01:00 -@@ -161,6 +161,7 @@ - void mutt_block_signals_system (void); - void mutt_body_handler (BODY *, STATE *); - int mutt_bounce_message (FILE *fp, HEADER *, ADDRESS *); -+void mutt_break_thread (HEADER *); - void mutt_buffy (char *, size_t); - int mutt_buffy_list (void); - void mutt_canonical_charset (char *, size_t, const char *); -@@ -302,6 +303,7 @@ - int mutt_is_subscribed_list (ADDRESS *); - int mutt_is_text_part (BODY *); - int mutt_is_valid_mailbox (const char *); -+int mutt_link_threads (HEADER *, HEADER *, CONTEXT *); - int mutt_lookup_mime_type (BODY *, const char *); - int mutt_match_rx_list (const char *, RX_LIST *); - int mutt_match_spam_list (const char *, SPAM_LIST *, char *, int); -diff -Nru a/thread.c b/thread.c ---- a/thread.c 2005-01-29 17:07:15 +01:00 -+++ b/thread.c 2005-01-29 17:07:15 +01:00 -@@ -1340,3 +1340,105 @@ - - return hash; - } -+ -+static void clean_references (THREAD *brk, THREAD *cur) -+{ -+ THREAD *p; -+ LIST *ref = NULL; -+ int done = 0; -+ -+ for (; cur; cur = cur->next, done = 0) -+ { -+ /* parse subthread recursively */ -+ clean_references (brk, cur->child); -+ -+ if (!cur->message) -+ break; /* skip pseudo-message */ -+ -+ /* Looking for the first bad reference according to the new threading. -+ * Optimal since Mutt stores the references in reverse order, and the -+ * first loop should match immediatly for mails respecting RFC2822. */ -+ for (p = brk; !done && p; p = p->parent) -+ for (ref = cur->message->env->references; p->message && ref; ref = ref->next) -+ if (!mutt_strcasecmp (ref->data, p->message->env->message_id)) -+ { -+ done = 1; -+ break; -+ } -+ -+ if (done) -+ { -+ HEADER *h = cur->message; -+ -+ /* clearing the References: header from obsolete Message-Id(s) */ -+ mutt_free_list (&ref->next); -+ -+#ifdef IMAP_EDIT_THREADS -+ if (h->new_env) -+ mutt_free_list (&h->new_env->references); -+ else -+ h->new_env = mutt_new_envelope (); -+ -+ h->new_env->references = mutt_copy_list (h->env->references); -+#endif -+ -+ h->refs_changed = h->changed = 1; -+ } -+ } -+} -+ -+void mutt_break_thread (HEADER *hdr) -+{ -+ mutt_free_list (&hdr->env->in_reply_to); -+ mutt_free_list (&hdr->env->references); -+ hdr->irt_changed = hdr->refs_changed = hdr->changed = 1; -+ -+#ifdef IMAP_EDIT_THREADS -+ if (hdr->new_env) -+ { -+ mutt_free_list (&hdr->new_env->in_reply_to); -+ mutt_free_list (&hdr->new_env->references); -+ } -+ else -+ hdr->new_env = mutt_new_envelope (); -+#endif -+ -+ clean_references (hdr->thread, hdr->thread->child); -+} -+ -+static int link_threads (HEADER *parent, HEADER *child, CONTEXT *ctx) -+{ -+ if (child == parent) -+ return 0; -+ -+ mutt_break_thread (child); -+ -+ child->env->in_reply_to = mutt_new_list (); -+ child->env->in_reply_to->data = safe_strdup (parent->env->message_id); -+ -+#ifdef IMAP_EDIT_THREADS -+ child->new_env->in_reply_to = mutt_new_list (); -+ child->new_env->in_reply_to->data = safe_strdup (parent->env->message_id); -+#endif -+ -+ mutt_set_flag (ctx, child, M_TAG, 0); -+ -+ child->irt_changed = child->changed = 1; -+ return 1; -+} -+ -+int mutt_link_threads (HEADER *cur, HEADER *last, CONTEXT *ctx) -+{ -+ int i, changed = 0; -+ -+ if (!last) -+ { -+ for (i = 0; i < ctx->vcount; i++) -+ if (ctx->hdrs[Context->v2r[i]]->tagged) -+ changed |= link_threads (cur, ctx->hdrs[Context->v2r[i]], ctx); -+ } -+ else -+ changed = link_threads (cur, last, ctx); -+ -+ return changed; -+} diff -ru /usr/ports/mail/mutt-devel/files/extra-patch-maildir-header-cache ./files/extra-patch-maildir-header-cache --- /usr/ports/mail/mutt-devel/files/extra-patch-maildir-header-cache Mon Mar 14 12:59:12 2005 +++ ./files/extra-patch-maildir-header-cache Sun Aug 14 13:18:43 2005 @@ -2,206 +2,255 @@ --- a/PATCHES +++ b/PATCHES @@ -0,0 +1 @@ -+mutt-cvs-header-cache.29 -diff -Nru a/init.h b/init.h ---- a/init.h 2005-02-12 22:08:19 +01:00 -+++ b/init.h 2005-02-13 00:51:10 +01:00 -@@ -1032,6 +1032,13 @@ - ** global header cache for all folders is used. Per default it is unset and so - ** no header caching will be used. - */ -+ { "maildir_header_cache_verify", DT_BOOL, R_NONE, OPTHCACHEVERIFY, 1 }, -+ /* -+ ** .pp -+ ** Check for Maildir unaware programs other than mutt having modified maildir -+ ** files when the header cache is in use. This incurs one stat(2) per -+ ** message every time the folder is opened. -+ */ - { "header_cache_pagesize", DT_STR, R_NONE, UL &HeaderCachePageSize, UL "16384" }, - /* - ** .pp -diff -Nru a/mh.c b/mh.c ---- a/mh.c 2005-02-03 19:01:43 +01:00 -+++ b/mh.c 2005-02-05 12:25:16 +01:00 -@@ -791,6 +791,14 @@ - return r; ++mutt-cvs-header-cache.30 +--- a/configure.in ++++ b/configure.in +@@ -804,10 +804,23 @@ + OLDLIBS="$LIBS" + + need_md5="yes" ++ ++ ac_prefer_qdbm=yes ++ AC_ARG_WITH(qdbm, AC_HELP_STRING([--without-qdbm], [Don't use qdbm even if it is available]), ++ ac_prefer_qdbm=$withval) ++ if test x$ac_prefer_qdbm != xno; then ++ CPPFLAGS="$OLDCPPFLAGS" ++ LIBS="$OLDLIBS -lqdbm"; ++ AC_CACHE_CHECK(for vlopen, ac_cv_vlopen,[ ++ ac_cv_vlopen=no ++ AC_TRY_LINK([#include <villa.h>],[vlopen(0,0,0);],[ac_cv_vlopen=yes]) ++ ]) ++ fi ++ + ac_prefer_gdbm=yes + AC_ARG_WITH(gdbm, AC_HELP_STRING([--without-gdbm], [Don't use gdbm even if it is available]), + ac_prefer_gdbm=$withval) +- if test x$ac_prefer_gdbm != xno; then ++ if test x$ac_prefer_gdbm != xno -a x$ac_cv_vlopen != xyes; then + CPPFLAGS="$OLDCPPFLAGS" + LIBS="$OLDLIBS -lgdbm"; + AC_CACHE_CHECK(for gdbm_open, ac_cv_gdbmopen,[ +@@ -819,7 +832,7 @@ + ac_bdb_prefix=yes + AC_ARG_WITH(bdb, AC_HELP_STRING([--with-bdb[=DIR]], [Use BerkeleyDB4 if gdbm is not available]), + ac_bdb_prefix=$withval) +- if test x$ac_bdb_prefix != xno -a x$ac_cv_gdbmopen != xyes; then ++ if test x$ac_bdb_prefix != xno -a x$ac_cv_gdbmopen != xyes -a x$ac_cv_vlopen != xyes; then + test x$ac_bdb_prefix = xyes && ac_bdb_prefix="$mutt_cv_prefix /opt/csw/bdb4 /opt /usr/local /usr" + for d in $ac_bdb_prefix; do + bdbpfx="$bdbpfx $d" +@@ -865,7 +878,11 @@ + fi + fi + +- if test x$ac_cv_gdbmopen = xyes; then ++ if test x$ac_cv_vlopen = xyes; then ++ CPPFLAGS="$OLDCPPFLAGS" ++ LIBS="$OLDLIBS -lqdbm"; ++ AC_DEFINE(HAVE_QDBM, 1, [QDBM Support]) ++ elif test x$ac_cv_gdbmopen = xyes; then + CPPFLAGS="$OLDCPPFLAGS" + LIBS="$OLDLIBS -lgdbm"; + AC_DEFINE(HAVE_GDBM, 1, [GDBM Support]) +--- a/hcache.c ++++ b/hcache.c +@@ -22,7 +22,11 @@ + #include "config.h" + #endif /* HAVE_CONFIG_H */ + +-#if HAVE_GDBM ++#if HAVE_QDBM ++#include <depot.h> ++#include <cabin.h> ++#include <villa.h> ++#elif HAVE_GDBM + #include <gdbm.h> + #elif HAVE_DB4 + #include <db.h> +@@ -42,7 +46,14 @@ + #include "lib.h" + #include "md5.h" + +-#if HAVE_GDBM ++#if HAVE_QDBM ++static struct header_cache ++{ ++ VILLA *db; ++ char *folder; ++ unsigned int crc; ++} HEADER_CACHE; ++#elif HAVE_GDBM + static struct header_cache + { + GDBM_FILE db; +@@ -615,7 +626,139 @@ + return h; } -+#if USE_HCACHE -+static size_t maildir_hcache_keylen (const char *fn) +-#if HAVE_GDBM ++#if HAVE_QDBM ++void * ++mutt_hcache_open(const char *path, const char *folder) +{ -+ const char * p = strrchr (fn, ':'); -+ return p ? (size_t) (p - fn) : mutt_strlen(fn); -+} -+#endif ++ struct header_cache *h = safe_calloc(1, sizeof (HEADER_CACHE)); ++ int flags = 0; ++#if 0 /* FIXME */ ++ int pagesize = atoi(HeaderCachePageSize) ? atoi(HeaderCachePageSize) : 16384; ++#endif ++ h->db = NULL; ++ h->folder = safe_strdup(folder); ++ h->crc = generate_crc32(); + - #ifdef USE_INODESORT - /* - * Merge two maildir lists according to the inode numbers. -@@ -886,27 +894,67 @@ - * This function does the second parsing pass for a maildir-style - * folder. - */ -- - void maildir_delayed_parsing (CONTEXT * ctx, struct maildir *md) - { - struct maildir *p; - char fn[_POSIX_PATH_MAX]; - int count; - -+#if USE_HCACHE -+ void *hc = NULL; -+ void *data; -+ struct timeval *when = NULL; -+ struct stat lastchanged; -+ int ret; ++ if (!path || path[0] == '\0') ++ { ++ FREE(&h->folder); ++ FREE(&h); ++ return NULL; ++ } + -+ hc = mutt_hcache_open (HeaderCache, ctx->path); -+#endif ++ path = mutt_hcache_per_folder(path, folder); + - for (p = md, count = 0; p; p = p->next, count++) -- if (p && p->h && !p->header_parsed) -- { -- if (!ctx->quiet && ReadInc && ((count % ReadInc) == 0 || count == 1)) -- mutt_message (_("Reading %s... %d"), ctx->path, count); -- snprintf (fn, sizeof (fn), "%s/%s", ctx->path, p->h->path); -- if (maildir_parse_message (ctx->magic, fn, p->h->old, p->h)) -- p->header_parsed = 1; -- else -- mutt_free_header (&p->h); -- } --} ++ if (option(OPTHCACHECOMPRESS)) ++ flags = VL_OZCOMP; ++ ++ h->db = vlopen(path, flags | VL_OWRITER | VL_OCREAT, VL_CMPLEX); ++ if (h->db) ++ return h; ++ ++ /* if rw failed try ro */ ++ h->db = vlopen(path, flags | VL_OREADER, 0); ++ if (h->db) ++ return h; ++ else + { -+ if (! (p && p->h && !p->header_parsed)) -+ continue; - -+ if (!ctx->quiet && ReadInc && ((count % ReadInc) == 0 || count == 1)) -+ mutt_message (_("Reading %s... %d"), ctx->path, count); - -+#if USE_HCACHE -+ data = mutt_hcache_fetch (hc, p->h->path + 3, &maildir_hcache_keylen); -+ when = (struct timeval *) data; -+#endif ++ FREE(&h->folder); ++ FREE(&h); ++ ++ return NULL; ++ } ++} + -+ snprintf (fn, sizeof (fn), "%s/%s", ctx->path, p->h->path); ++void ++mutt_hcache_close(void *db) ++{ ++ struct header_cache *h = db; ++ ++ if (!h) ++ return; ++ ++ vlclose(h->db); ++ FREE(&h->folder); ++ FREE(&h); ++} + -+#if USE_HCACHE -+ if (option(OPTHCACHEVERIFY)) -+ ret = stat(fn, &lastchanged); -+ else { -+ lastchanged.st_mtime = 0; -+ ret = 0; ++void * ++mutt_hcache_fetch(void *db, const char *filename, ++ size_t(*keylen) (const char *fn)) ++{ ++ struct header_cache *h = db; ++ char path[_POSIX_PATH_MAX]; ++ int ksize; ++ char *data = NULL; ++ ++ if (!h) ++ return NULL; ++ ++ strncpy(path, h->folder, sizeof (path)); ++ safe_strcat(path, sizeof (path), filename); ++ ++ ksize = strlen(h->folder) + keylen(path + strlen(h->folder)); ++ ++ data = vlget(h->db, path, ksize, NULL); ++ ++ if (! crc32_matches(data, h->crc)) ++ { ++ if (data) { ++ FREE(&data); + } -+ -+ if (data != NULL && !ret && lastchanged.st_mtime <= when->tv_sec) -+ { -+ p->h = mutt_hcache_restore ((unsigned char *)data, &p->h); -+ maildir_parse_flags (p->h, fn); -+ } else -+#endif -+ if (maildir_parse_message (ctx->magic, fn, p->h->old, p->h)) -+ { -+ p->header_parsed = 1; -+#if USE_HCACHE -+ mutt_hcache_store (hc, p->h->path + 3, p->h, 0, &maildir_hcache_keylen); -+#endif -+ } else -+ mutt_free_header (&p->h); -+#if USE_HCACHE -+ FREE(&data); -+#endif ++ return NULL; + } -+#if USE_HCACHE -+ mutt_hcache_close (hc); -+#endif ++ ++ return data; +} ++ ++int ++mutt_hcache_store(void *db, const char *filename, HEADER * header, ++ unsigned long uid_validity, ++ size_t(*keylen) (const char *fn)) ++{ ++ struct header_cache *h = db; ++ char path[_POSIX_PATH_MAX]; ++ int ret; ++ int ksize, dsize; ++ char *data = NULL; ++ ++ if (!h) ++ return -1; ++ ++ strncpy(path, h->folder, sizeof (path)); ++ safe_strcat(path, sizeof (path), filename); ++ ++ ksize = strlen(h->folder) + keylen(path + strlen(h->folder)); ++ ++ data = mutt_hcache_dump(db, header, &dsize, uid_validity); ++ ++ ret = vlput(h->db, path, ksize, data, dsize, VL_DOVER); ++ ++ FREE(&data); ++ ++ return ret; ++} ++ ++int ++mutt_hcache_delete(void *db, const char *filename, ++ size_t(*keylen) (const char *fn)) ++{ ++ struct header_cache *h = db; ++ char path[_POSIX_PATH_MAX]; ++ int ksize; ++ ++ if (!h) ++ return -1; ++ ++ strncpy(path, h->folder, sizeof (path)); ++ safe_strcat(path, sizeof (path), filename); ++ ++ ksize = strlen(h->folder) + keylen(path + strlen(h->folder)); ++ ++ return vlout(h->db, path, ksize); ++} ++ ++#elif HAVE_GDBM - /* Read a MH/maildir style mailbox. - * -@@ -1403,6 +1451,9 @@ - { - char path[_POSIX_PATH_MAX], tmp[_POSIX_PATH_MAX]; - int i, j; -+#if USE_HCACHE -+ void *hc = NULL; -+#endif /* USE_HCACHE */ - - if (ctx->magic == M_MH) - i = mh_check_mailbox (ctx, index_hint); -@@ -1412,6 +1463,11 @@ - if (i != 0) - return i; - -+#if USE_HCACHE -+ if (ctx->magic == M_MAILDIR) -+ hc = mutt_hcache_open(HeaderCache, ctx->path); -+#endif /* USE_HCACHE */ -+ - for (i = 0; i < ctx->msgcount; i++) - { - if (ctx->hdrs[i]->deleted -@@ -1420,7 +1476,13 @@ - snprintf (path, sizeof (path), "%s/%s", ctx->path, ctx->hdrs[i]->path); - if (ctx->magic == M_MAILDIR - || (option (OPTMHPURGE) && ctx->magic == M_MH)) -+ { -+#if USE_HCACHE -+ if (ctx->magic == M_MAILDIR) -+ mutt_hcache_delete (hc, ctx->hdrs[i]->path + 3, &maildir_hcache_keylen); -+#endif /* USE_HCACHE */ - unlink (path); -+ } - else if (ctx->magic == M_MH) - { - /* MH just moves files out of the way when you delete them */ -@@ -1442,16 +1504,21 @@ - if (ctx->magic == M_MAILDIR) - { - if (maildir_sync_message (ctx, i) == -1) -- return -1; -+ goto err; - } - else - { - if (mh_sync_message (ctx, i) == -1) -- return -1; -+ goto err; - } - } - } - -+#if USE_HCACHE -+ if (ctx->magic == M_MAILDIR) -+ mutt_hcache_close (hc); -+#endif /* USE_HCACHE */ -+ - if (ctx->magic == M_MH) - mh_update_sequences (ctx); - -@@ -1472,6 +1539,13 @@ - } - - return 0; -+ -+err: -+#if USE_HCACHE -+ if (ctx->magic == M_MAILDIR) -+ mutt_hcache_close (hc); -+#endif /* USE_HCACHE */ -+ return -1; - } - - static char *maildir_canon_filename (char *dest, const char *src, size_t l) -diff -Nru a/mutt.h b/mutt.h ---- a/mutt.h 2005-02-12 21:19:25 +01:00 -+++ b/mutt.h 2005-02-13 00:51:10 +01:00 -@@ -351,6 +351,9 @@ - OPTFORCENAME, - OPTFORWDECODE, + void * + mutt_hcache_open(const char *path, const char *folder) +--- a/init.h ++++ b/init.h +@@ -1079,6 +1079,15 @@ + ** files when the header cache is in use. This incurs one stat(2) per + ** message every time the folder is opened. + */ ++#if HAVE_QDBM ++ { "header_cache_compress", DT_BOOL, R_NONE, OPTHCACHECOMPRESS, 0 }, ++ /* ++ ** .pp ++ ** If enabled the header cache will be compressed. So only one fifth of the usual ++ ** diskspace is used, but the uncompression can result in a slower open of the ++ ** cached folder. ++ */ ++#endif /* HAVE_QDBM */ + { "header_cache_pagesize", DT_STR, R_NONE, UL &HeaderCachePageSize, UL "16384" }, + /* + ** .pp +--- a/mutt.h ++++ b/mutt.h +@@ -353,6 +353,9 @@ OPTFORWQUOTE, -+#if USE_HCACHE -+ OPTHCACHEVERIFY, -+#endif + #if USE_HCACHE + OPTHCACHEVERIFY, ++#if HAVE_QDBM ++ OPTHCACHECOMPRESS, ++#endif /* HAVE_QDBM */ + #endif OPTHDRS, OPTHEADER, - OPTHELP, diff -ru /usr/ports/mail/mutt-devel/files/extra-patch-nodoc-contrib ./files/extra-patch-nodoc-contrib --- /usr/ports/mail/mutt-devel/files/extra-patch-nodoc-contrib Sat Feb 12 22:11:47 2005 +++ ./files/extra-patch-nodoc-contrib Sun Aug 14 13:01:54 2005 @@ -9,20 +9,20 @@ bin_SCRIPTS = muttbug flea @SMIMEAUX_TARGET@ ---- doc/Makefile.in.orig Fri Feb 4 13:46:04 2005 -+++ doc/Makefile.in Fri Feb 4 13:47:49 2005 -@@ -92,14 +92,6 @@ +--- doc/Makefile.in.orig Sun Aug 14 11:35:31 2005 ++++ doc/Makefile.in Sun Aug 14 11:37:23 2005 +@@ -93,14 +93,6 @@ ./instdoc muttrc.man $(DESTDIR)$(mandir)/man5/muttrc.5 ./instdoc $(srcdir)/mbox.man $(DESTDIR)$(mandir)/man5/mbox.5 ./instdoc $(srcdir)/mmdf.man $(DESTDIR)$(mandir)/man5/mmdf.5 - $(top_srcdir)/mkinstalldirs $(DESTDIR)$(docdir) -- for f in $(srcdir_DOCFILES) ; do \ -- $(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(docdir) ; \ -- done - for f in $(topsrcdir_DOCFILES) ; do \ - $(INSTALL) -m 644 $(top_srcdir)/$$f $(DESTDIR)$(docdir) ; \ - done +- for f in $(srcdir_DOCFILES) ; do \ +- $(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(docdir) ; \ +- done - $(INSTALL) -m 644 manual.txt $(DESTDIR)$(docdir) || true uninstall: - -rm -f $(DESTDIR)$(mandir)/man1/mutt.1 + for f in mutt.1 mutt_dotlock.1 flea.1 muttbug.1 ; do \ diff -ru /usr/ports/mail/mutt-devel/files/extra-patch-sgmlformat ./files/extra-patch-sgmlformat --- /usr/ports/mail/mutt-devel/files/extra-patch-sgmlformat Fri Aug 30 14:32:58 2002 +++ ./files/extra-patch-sgmlformat Thu Aug 18 10:15:20 2005 @@ -4,8 +4,8 @@ topsrcdir_DOCFILES = COPYRIGHT GPL INSTALL ChangeLog \ README NEWS TODO README.SECURITY README.SSL --all: -+all: muttrc.man try-html try-txt try-latin1 try-ps +-all: mutt.1 ++all: mutt.1 muttrc.man try-html try-txt try-latin1 try-ps try-html: ../makedoc rm -f *.html && $(MAKE) manual.html || cp $(srcdir)/manual*.html ./ diff -ru /usr/ports/mail/mutt-devel/files/patch-02 ./files/patch-02 --- /usr/ports/mail/mutt-devel/files/patch-02 Mon Mar 14 12:59:12 2005 +++ ./files/patch-02 Thu Aug 18 10:15:20 2005 @@ -1,34 +1,34 @@ ---- doc/Makefile.in.orig Tue Feb 15 20:28:24 2005 -+++ doc/Makefile.in Mon Mar 14 08:08:25 2005 -@@ -63,13 +63,23 @@ +--- doc/Makefile.in.orig Thu Aug 11 21:37:02 2005 ++++ doc/Makefile.in Sun Aug 14 11:09:10 2005 +@@ -64,13 +64,23 @@ ChangeLog.old \ README NEWS TODO README.SECURITY README.SSL --all: muttrc.man try-html try-txt -+all: +-all: mutt.1 muttrc.man try-html try-txt ++all: mutt.1 - try-html: ../makedoc + try-html: ../makedoc$(EXEEXT) - test -f manual.html || $(MAKE) manual.html || cp $(srcdir)/manual*.html ./ + rm -f *.html && $(MAKE) manual.html || cp $(srcdir)/manual*.html ./ + touch $@ - try-txt: ../makedoc + try-txt: ../makedoc$(EXEEXT) - test -f manual.txt || $(MAKE) manual.txt || cp $(srcdir)/manual.txt ./ + $(MAKE) manual.txt || cp $(srcdir)/manual.txt ./ + touch $@ + -+try-latin1: ++try-latin1: ../makedoc$(EXEEXT) + $(MAKE) manual.latin1 || cp $(srcdir)/manual.latin1 ./ + touch $@ + -+try-ps: -+ $(MAKE) manual.ps || cp $(srcdir)/manual.ps ./ ++try-ps: ../makedoc$(EXEEXT) ++ $(MAKE) manual.ps || cp $(srcdir)/manual.latin1 ./ + touch $@ install: all instdoc $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man1 -@@ -90,10 +100,6 @@ - $(INSTALL) -m 644 $(top_srcdir)/$$f $(DESTDIR)$(docdir) ; \ +@@ -91,10 +101,6 @@ + $(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(docdir) ; \ done $(INSTALL) -m 644 manual.txt $(DESTDIR)$(docdir) || true - $(top_srcdir)/mkinstalldirs $(DESTDIR)$(docdir)/html @@ -37,12 +37,12 @@ - done uninstall: - -rm -f $(DESTDIR)$(mandir)/man1/mutt.1 -@@ -103,17 +109,20 @@ + for f in mutt.1 mutt_dotlock.1 flea.1 muttbug.1 ; do \ +@@ -114,17 +120,20 @@ check: manual.txt: manual.sgml -- if linuxdoc -B txt --pass='-P -c' manual ; then \ +- if linuxdoc -B txt -c latin --pass='-P -c' manual ; then \ - uniq < manual.txt | expand > _manual.txt ; \ - rm manual.txt ; \ + if sgmlfmt -f ascii manual; then \ diff -ru /usr/ports/mail/mutt-devel/files/patch-doc-mutt.1 ./files/patch-doc-mutt.1 --- /usr/ports/mail/mutt-devel/files/patch-doc-mutt.1 Thu Jan 1 01:00:00 1970 +++ ./files/patch-doc-mutt.1 Sun Aug 14 13:01:18 2005 @@ -0,0 +1,11 @@ +--- doc/Makefile.in.orig Sun Aug 14 11:27:21 2005 ++++ doc/Makefile.in Sun Aug 14 11:28:38 2005 +@@ -179,7 +179,7 @@ + -e 's,@docdir\@,$(docdir),g' + + mutt.1: $(srcdir)/mutt.man +- $(EDIT) $< > $@ ++ $(EDIT) $(srcdir)/mutt.man > $@ + + muttrc.man stamp-doc-man: ../makedoc$(EXEEXT) $(top_srcdir)/init.h muttrc.man.head muttrc.man.tail + $(MAKEDOC_CPP) $(top_srcdir)/init.h | ../makedoc -m | \ diff -ru /usr/ports/mail/mutt-devel/files/patch-doc-mutt.man ./files/patch-doc-mutt.man --- /usr/ports/mail/mutt-devel/files/patch-doc-mutt.man Sun Oct 26 14:14:24 2003 +++ ./files/patch-doc-mutt.man Sun Aug 14 13:01:54 2005 @@ -1,17 +1,3 @@ ---- doc/mutt.man.orig Wed Nov 13 11:07:05 2002 -+++ doc/mutt.man Wed Sep 24 15:36:17 2003 -@@ -148,9 +148,9 @@ - User's personal mapping between MIME types and file extensions. - .IP "/etc/mime.types" - System mapping between MIME types and file extensions. --.IP "/usr/local/bin/mutt_dotlock" -+.IP "${PREFIX}/bin/mutt_dotlock" - The privileged dotlocking program. --.IP "/usr/local/doc/mutt/manual.txt" -+.IP "${DOCSDIR}/manual.txt" - The Mutt manual. - .SH BUGS - .PP --- doc/muttrc.man.orig Wed Mar 19 22:55:03 2003 +++ doc/muttrc.man Sun Oct 26 11:16:05 2003 @@ -1031,7 +1031,7 @@ diff -ru /usr/ports/mail/mutt-devel/scripts/generate-plist ./scripts/generate-plist --- /usr/ports/mail/mutt-devel/scripts/generate-plist Mon Jul 4 04:49:05 2005 +++ ./scripts/generate-plist Sun Aug 14 13:01:54 2005 @@ -126,7 +126,7 @@ fi if [ "$MUTT_HTML" = "yes" ]; then - html=383 + html=395 if [ "$MUTT_COMPRESSED_FOLDERS" = "yes" ]; then html=$(($html + 5)) fi @@ -136,15 +136,6 @@ if [ "$MUTT_QUOTE_PATCH" = "yes" ]; then html=$(($html + 2)) fi - if [ "$MUTT_EDIT_THREADS" = "yes" ]; then - html=$(($html + 3)) - fi - if [ "$MUTT_IMAP_HEADER_CACHE" = "yes" ]; then - html=$(($html + 2)) - fi - if [ "$MUTT_MAILDIR_HEADER_CACHE" = "yes" ]; then - html=$(($html + 1)) - fi if [ "$MUTT_SIDEBAR_PATCH" = "yes" ]; then html=$(($html + 2)) fi @@ -152,9 +143,6 @@ html=$(($html + 1)) fi if [ "$MUTT_IFDEF_PATCH" = "yes" ]; then - html=$(($html + 1)) - fi - if [ "$MUTT_IDN" = "yes" ]; then html=$(($html + 1)) fi if [ "$MUTT_REVERSE_REPLY_PATCH" = "yes" ]; then
Hi Udo, Do you have an updated patch to upgrade mutt-devel from 1.5.9 to 1.5.10? The patch in PR 84907 does not cleanly apply to latest files in CVS. thanks, -- -- David (obrien@FreeBSD.org)
State Changed From-To: open->closed Committed! Thanks.