From owner-svn-ports-head@freebsd.org Sun Sep 13 09:18:11 2015 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6127C9C8B39; Sun, 13 Sep 2015 09:18:11 +0000 (UTC) (envelope-from riggs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 514141DE9; Sun, 13 Sep 2015 09:18:11 +0000 (UTC) (envelope-from riggs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8D9IBe1047793; Sun, 13 Sep 2015 09:18:11 GMT (envelope-from riggs@FreeBSD.org) Received: (from riggs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8D9IAMO047787; Sun, 13 Sep 2015 09:18:10 GMT (envelope-from riggs@FreeBSD.org) Message-Id: <201509130918.t8D9IAMO047787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: riggs set sender to riggs@FreeBSD.org using -f From: Thomas Zander Date: Sun, 13 Sep 2015 09:18:10 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r396802 - in head/mail/mutt: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2015 09:18:11 -0000 Author: riggs Date: Sun Sep 13 09:18:09 2015 New Revision: 396802 URL: https://svnweb.freebsd.org/changeset/ports/396802 Log: Update to upstream version 1.5.24, add MIXMASTER OPTION PR: 203056, 202114 Submitted by: Udo.Schweigert@siemens.com (maintainer) Deleted: head/mail/mutt/files/patch-CVE-2014-9116 head/mail/mutt/files/patch-curs_lib.c head/mail/mutt/files/patch-gpg_agent_info head/mail/mutt/files/patch-pgpkey.c Modified: head/mail/mutt/Makefile head/mail/mutt/distinfo head/mail/mutt/files/extra-patch-sidebar head/mail/mutt/files/extra-patch-sidebar-nntp head/mail/mutt/files/extra-patch-trash-purge head/mail/mutt/files/patch-Makefile.am head/mail/mutt/files/patch-examples head/mail/mutt/files/patch-mktemp head/mail/mutt/files/patch-smime-self head/mail/mutt/files/patch-smime-sender head/mail/mutt/files/patch-staging-Makefile.am Modified: head/mail/mutt/Makefile ============================================================================== --- head/mail/mutt/Makefile Sun Sep 13 07:55:25 2015 (r396801) +++ head/mail/mutt/Makefile Sun Sep 13 09:18:09 2015 (r396802) @@ -2,15 +2,13 @@ # $FreeBSD$ PORTNAME= mutt -PORTVERSION= 1.5.23 -PORTREVISION?= 9 +PORTVERSION= 1.5.24 +PORTREVISION?= 0 CATEGORIES+= mail ipv6 MASTER_SITES= ftp://ftp.mutt.org/mutt/ \ - ftp://ftp.mutt.org/mutt/devel/ \ ftp://ftp.fu-berlin.de/pub/unix/mail/mutt/ \ - ftp://ftp.fu-berlin.de/pub/unix/mail/mutt/devel/ \ + https://bitbucket.org/mutt/mutt/downloads/ \ ftp://ftp.demon.co.uk/pub/mirrors/mutt/ \ - ftp://ftp.demon.co.uk/pub/mirrors/mutt/devel/ \ http://www.mutt.org.ua/download/mutt-${VVV_PATCH_VERSION}/:vvv \ http://www2.mutt.org.ua/download/mutt-${VVV_PATCH_VERSION}/:vvv \ http://www3.mutt.org.ua/download/mutt-${VVV_PATCH_VERSION}/:vvv \ @@ -66,7 +64,7 @@ OPTIONS_DEFINE= COMPRESSED_FOLDERS SASL GPGME GREETING_PATCH GSSAPI HTML ICONV IDN IFDEF_PATCH \ IMAP_HEADER_CACHE LOCALES_FIX MAILBOX_MANPAGES \ MAILDIR_HEADER_CACHE MAILDIR_MTIME_PATCH \ - NLS NNTP PARENT_CHILD_MATCH_PATCH \ + MIXMASTER NLS NNTP PARENT_CHILD_MATCH_PATCH \ QUOTE_PATCH REVERSE_REPLY_PATCH SIDEBAR_PATCH \ SIGNATURE_MENU SMART_DATE SMIME_OUTLOOK_COMPAT SMTP \ TOKYOCABINET TRASH_PATCH XML @@ -91,6 +89,7 @@ MAILBOX_MANPAGES_DESC= Install mbox.5/mm MAILDIR_HEADER_CACHE_DESC= Maildir header cache MAILDIR_MTIME_PATCH_DESC= Maildir mtime patch MBOX_HOOK_PATCH_DESC= Enhanced mbox-hook +MIXMASTER_DESC= Mixmaster support NCURSES_DESC= Ncurses support NLS_DESC= Native language support PARENT_CHILD_MATCH_PATCH_DESC= Parent/child match @@ -188,6 +187,12 @@ LIB_DEPENDS+= libsasl2.so:${PORTSDIR}/se CONFIGURE_ARGS+= --with-sasl=${LOCALBASE} .endif +.if ${PORT_OPTIONS:MMIXMASTER} +# BUILD_DEPENDS+= mixmaster:${PORTSDIR}/mail/mixmaster +RUN_DEPENDS+= mixmaster:${PORTSDIR}/mail/mixmaster +CONFIGURE_ARGS+= --with-mixmaster=${LOCALBASE} +.endif + .if ${PORT_OPTIONS:MSMIME_OUTLOOK_COMPAT} post-patch:: @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-smime-outlook Modified: head/mail/mutt/distinfo ============================================================================== --- head/mail/mutt/distinfo Sun Sep 13 07:55:25 2015 (r396801) +++ head/mail/mutt/distinfo Sun Sep 13 09:18:09 2015 (r396802) @@ -1,12 +1,12 @@ -SHA256 (mutt/mutt-1.5.23.tar.gz) = 3af0701e57b9e1880ed3a0dee34498a228939e854a16cdccd24e5e502626fd37 -SIZE (mutt/mutt-1.5.23.tar.gz) = 3782032 -SHA256 (mutt/patch-1.5.23.rr.compressed.gz) = 585d0df6e251ca4519327e85923f580d685fc33aaa9c8c532e0916224b43134f -SIZE (mutt/patch-1.5.23.rr.compressed.gz) = 10127 -SHA256 (mutt/patch-1.5.23.vvv.nntp.gz) = 281f56aa60b01860f4b5d4ad43a000a14d39d7a69c17fa3983dc6463e1675589 -SIZE (mutt/patch-1.5.23.vvv.nntp.gz) = 61184 -SHA256 (mutt/patch-1.5.23.vvv.nntp_ru.gz) = 8e36a8eb90bb9085d5fdf8bde1d80adff90c7d1e0982eae34b81df4eb2e5c6bd -SIZE (mutt/patch-1.5.23.vvv.nntp_ru.gz) = 5733 -SHA256 (mutt/patch-1.5.23.vvv.initials.gz) = d02fc55ac846bcaa241a1af644988d906192081584f85d971be42c37f39e6e23 -SIZE (mutt/patch-1.5.23.vvv.initials.gz) = 673 -SHA256 (mutt/patch-1.5.23.vvv.quote.gz) = 2e98fafe8e221e1a0dd923bd71bf53245aa1141c99aae4c93bef35f1a25cdc10 -SIZE (mutt/patch-1.5.23.vvv.quote.gz) = 1260 +SHA256 (mutt/mutt-1.5.24.tar.gz) = a292ca765ed7b19db4ac495938a3ef808a16193b7d623d65562bb8feb2b42200 +SIZE (mutt/mutt-1.5.24.tar.gz) = 3897115 +SHA256 (mutt/patch-1.5.24.rr.compressed.gz) = c5eb9b53f7bd3feaa5ee03722575f64e43512b756c099ffe20db6fe5c958e3dc +SIZE (mutt/patch-1.5.24.rr.compressed.gz) = 10019 +SHA256 (mutt/patch-1.5.24.vvv.nntp.gz) = d34be4542d549aab6de9f7038c88b3eeefe826db643c92b27e1e65ab5f7d573e +SIZE (mutt/patch-1.5.24.vvv.nntp.gz) = 61359 +SHA256 (mutt/patch-1.5.24.vvv.nntp_ru.gz) = 70436af316aefd0d31aa33e127df49da4bdd1b4a8b3fbec73b3fca5428f3ab0e +SIZE (mutt/patch-1.5.24.vvv.nntp_ru.gz) = 5719 +SHA256 (mutt/patch-1.5.24.vvv.initials.gz) = 6522d12d34c0be71531465e05010413a0f2907d597e9fb5100a65d18093f0599 +SIZE (mutt/patch-1.5.24.vvv.initials.gz) = 671 +SHA256 (mutt/patch-1.5.24.vvv.quote.gz) = fa161302179bbc646a83d7029381f828bece5b177e940f2fca6d5769633b9f0a +SIZE (mutt/patch-1.5.24.vvv.quote.gz) = 1254 Modified: head/mail/mutt/files/extra-patch-sidebar ============================================================================== --- head/mail/mutt/files/extra-patch-sidebar Sun Sep 13 07:55:25 2015 (r396801) +++ head/mail/mutt/files/extra-patch-sidebar Sun Sep 13 09:18:09 2015 (r396802) @@ -1,281 +1,236 @@ Taken from http://lunar-linux.org/~tchan/mutt/patch-1.5.23.sidebar.20140412.txt diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c -*** mutt-1.5.23-orig/buffy.c 2014-03-12 11:03:44.000000000 -0500 ---- mutt-1.5.23/buffy.c 2014-04-12 15:33:54.000000000 -0500 -*************** -*** 161,166 **** ---- 161,209 ---- - } - } - -+ static int buffy_compare_name(const void *a, const void *b) { -+ const BUFFY *b1 = * (BUFFY * const *) a; -+ const BUFFY *b2 = * (BUFFY * const *) b; -+ -+ return mutt_strcoll(b1->path, b2->path); -+ } -+ -+ static BUFFY *buffy_sort(BUFFY *b) -+ { -+ BUFFY *tmp = b; -+ int buffycount = 0; -+ BUFFY **ary; -+ int i; -+ -+ if (!option(OPTSIDEBARSORT)) -+ return b; -+ -+ for (; tmp != NULL; tmp = tmp->next) -+ buffycount++; -+ -+ ary = (BUFFY **) safe_calloc(buffycount, sizeof (*ary)); -+ -+ tmp = b; -+ for (i = 0; tmp != NULL; tmp = tmp->next, i++) { -+ ary[i] = tmp; -+ } -+ -+ qsort(ary, buffycount, sizeof(*ary), buffy_compare_name); -+ -+ for (i = 0; i < buffycount - 1; i++) { -+ ary[i]->next = ary[i+1]; -+ } -+ ary[buffycount - 1]->next = NULL; -+ for (i = 1; i < buffycount; i++) { -+ ary[i]->prev = ary[i-1]; -+ } -+ ary[0]->prev = NULL; -+ -+ tmp = ary[0]; -+ free(ary); -+ return tmp; -+ } -+ - BUFFY *mutt_find_mailbox (const char *path) - { - BUFFY *tmp = NULL; -*************** -*** 196,204 **** ---- 239,251 ---- - static BUFFY *buffy_new (const char *path) - { - BUFFY* buffy; -+ char rp[PATH_MAX]; -+ char *r; - - buffy = (BUFFY *) safe_calloc (1, sizeof (BUFFY)); - strfcpy (buffy->path, path, sizeof (buffy->path)); -+ r = realpath(path, rp); -+ strfcpy (buffy->realpath, r ? rp : path, sizeof (buffy->realpath)); - buffy->next = NULL; - buffy->magic = 0; - -*************** -*** 243,250 **** - p = realpath (buf, f1); - for (tmp = &Incoming; *tmp; tmp = &((*tmp)->next)) - { -! q = realpath ((*tmp)->path, f2); -! if (mutt_strcmp (p ? p : buf, q ? q : (*tmp)->path) == 0) - { - dprint(3,(debugfile,"mailbox '%s' already registered as '%s'\n", buf, (*tmp)->path)); - break; ---- 290,297 ---- - p = realpath (buf, f1); - for (tmp = &Incoming; *tmp; tmp = &((*tmp)->next)) - { -! q = (*tmp)->realpath; -! if (mutt_strcmp (p ? p : buf, q) == 0) - { - dprint(3,(debugfile,"mailbox '%s' already registered as '%s'\n", buf, (*tmp)->path)); - break; -*************** -*** 282,287 **** ---- 329,335 ---- - else - (*tmp)->size = 0; - } -+ Incoming = buffy_sort(Incoming); - return 0; - } - -*************** -*** 306,311 **** ---- 354,364 ---- - return 0; - } - -+ if (option(OPTSIDEBAR) && mailbox->msg_unread > 0) { -+ mailbox->new = 1; -+ return 1; -+ } -+ - if ((dirp = opendir (path)) == NULL) - { - mailbox->magic = 0; -*************** -*** 340,345 **** ---- 393,464 ---- - return rc; - } - -+ /* update message counts for the sidebar */ -+ void buffy_maildir_update (BUFFY* mailbox) -+ { -+ char path[_POSIX_PATH_MAX]; -+ DIR *dirp; -+ struct dirent *de; -+ char *p; -+ -+ if(!option(OPTSIDEBAR)) -+ return; -+ -+ mailbox->msgcount = 0; -+ mailbox->msg_unread = 0; -+ mailbox->msg_flagged = 0; -+ -+ snprintf (path, sizeof (path), "%s/new", mailbox->path); -+ -+ if ((dirp = opendir (path)) == NULL) -+ { -+ mailbox->magic = 0; -+ return; -+ } -+ -+ while ((de = readdir (dirp)) != NULL) -+ { -+ if (*de->d_name == '.') -+ continue; -+ -+ if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) { -+ mailbox->new = 1; -+ mailbox->msgcount++; -+ mailbox->msg_unread++; -+ } -+ } -+ -+ closedir (dirp); -+ snprintf (path, sizeof (path), "%s/cur", mailbox->path); -+ -+ if ((dirp = opendir (path)) == NULL) -+ { -+ mailbox->magic = 0; -+ return; -+ } -+ -+ while ((de = readdir (dirp)) != NULL) -+ { -+ if (*de->d_name == '.') -+ continue; -+ -+ if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) { -+ mailbox->msgcount++; -+ if ((p = strstr (de->d_name, ":2,"))) { -+ if (!strchr (p + 3, 'T')) { -+ if (!strchr (p + 3, 'S')) -+ mailbox->msg_unread++; -+ if (strchr(p + 3, 'F')) -+ mailbox->msg_flagged++; -+ } -+ } -+ } -+ } -+ -+ mailbox->sb_last_checked = time(NULL); -+ closedir (dirp); -+ } -+ - /* returns 1 if mailbox has new mail */ - static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb) - { -*************** -*** 351,357 **** - else - statcheck = sb->st_mtime > sb->st_atime - || (mailbox->newly_created && sb->st_ctime == sb->st_mtime && sb->st_ctime == sb->st_atime); -! if (statcheck) - { - if (!option(OPTMAILCHECKRECENT) || sb->st_mtime > mailbox->last_visited) - { ---- 470,476 ---- - else - statcheck = sb->st_mtime > sb->st_atime - || (mailbox->newly_created && sb->st_ctime == sb->st_mtime && sb->st_ctime == sb->st_atime); -! if ((!option(OPTSIDEBAR) && statcheck) || (option(OPTSIDEBAR) && mailbox->msg_unread > 0)) - { - if (!option(OPTMAILCHECKRECENT) || sb->st_mtime > mailbox->last_visited) - { -*************** -*** 371,376 **** ---- 490,516 ---- - return rc; - } - -+ /* update message counts for the sidebar */ -+ void buffy_mbox_update (BUFFY* mailbox, struct stat *sb) -+ { -+ CONTEXT *ctx = NULL; -+ -+ if(!option(OPTSIDEBAR)) -+ return; -+ if(mailbox->sb_last_checked > sb->st_mtime && mailbox->msgcount != 0) -+ return; /* no check necessary */ -+ -+ ctx = mx_open_mailbox(mailbox->path, M_READONLY | M_QUIET | M_NOSORT | M_PEEK, NULL); -+ if(ctx) -+ { -+ mailbox->msgcount = ctx->msgcount; -+ mailbox->msg_unread = ctx->unread; -+ mailbox->msg_flagged = ctx->flagged; -+ mailbox->sb_last_checked = time(NULL); -+ mx_close_mailbox(ctx, 0); -+ } -+ } -+ - int mutt_buffy_check (int force) - { - BUFFY *tmp; -*************** -*** 444,460 **** - { - case M_MBOX: - case M_MMDF: - if (buffy_mbox_hasnew (tmp, &sb) > 0) - BuffyCount++; - break; - - case M_MAILDIR: - if (buffy_maildir_hasnew (tmp) > 0) - BuffyCount++; - break; - - case M_MH: -! mh_buffy(tmp); - if (tmp->new) - BuffyCount++; - break; ---- 584,603 ---- - { - case M_MBOX: - case M_MMDF: -+ buffy_mbox_update (tmp, &sb); - if (buffy_mbox_hasnew (tmp, &sb) > 0) - BuffyCount++; - break; - - case M_MAILDIR: -+ buffy_maildir_update (tmp); - if (buffy_maildir_hasnew (tmp) > 0) - BuffyCount++; - break; - - case M_MH: -! mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged, &tmp->sb_last_checked); -! mh_buffy(tmp); - if (tmp->new) - BuffyCount++; - break; +*** mutt-1.5.23-orig/buffy.c.orig 2015-08-30 19:06:38.000000000 +0200 +--- mutt-1.5.23/buffy.c 2015-09-10 09:31:22.000000000 +0200 +@@ -161,6 +161,49 @@ + } + } + ++static int buffy_compare_name(const void *a, const void *b) { ++ const BUFFY *b1 = * (BUFFY * const *) a; ++ const BUFFY *b2 = * (BUFFY * const *) b; ++ ++ return mutt_strcoll(b1->path, b2->path); ++} ++ ++static BUFFY *buffy_sort(BUFFY *b) ++{ ++ BUFFY *tmp = b; ++ int buffycount = 0; ++ BUFFY **ary; ++ int i; ++ ++ if (!option(OPTSIDEBARSORT)) ++ return b; ++ ++ for (; tmp != NULL; tmp = tmp->next) ++ buffycount++; ++ ++ ary = (BUFFY **) safe_calloc(buffycount, sizeof (*ary)); ++ ++ tmp = b; ++ for (i = 0; tmp != NULL; tmp = tmp->next, i++) { ++ ary[i] = tmp; ++ } ++ ++ qsort(ary, buffycount, sizeof(*ary), buffy_compare_name); ++ ++ for (i = 0; i < buffycount - 1; i++) { ++ ary[i]->next = ary[i+1]; ++ } ++ ary[buffycount - 1]->next = NULL; ++ for (i = 1; i < buffycount; i++) { ++ ary[i]->prev = ary[i-1]; ++ } ++ ary[0]->prev = NULL; ++ ++ tmp = ary[0]; ++ free(ary); ++ return tmp; ++} ++ + BUFFY *mutt_find_mailbox (const char *path) + { + BUFFY *tmp = NULL; +@@ -196,9 +239,13 @@ + static BUFFY *buffy_new (const char *path) + { + BUFFY* buffy; ++ char rp[PATH_MAX]; ++ char *r; + + buffy = (BUFFY *) safe_calloc (1, sizeof (BUFFY)); + strfcpy (buffy->path, path, sizeof (buffy->path)); ++ r = realpath(path, rp); ++ strfcpy (buffy->realpath, r ? rp : path, sizeof (buffy->realpath)); + buffy->next = NULL; + buffy->magic = 0; + +@@ -243,8 +290,8 @@ + p = realpath (buf, f1); + for (tmp = &Incoming; *tmp; tmp = &((*tmp)->next)) + { +- q = realpath ((*tmp)->path, f2); +- if (mutt_strcmp (p ? p : buf, q ? q : (*tmp)->path) == 0) ++ q = (*tmp)->realpath; ++ if (mutt_strcmp (p ? p : buf, q) == 0) + { + dprint(3,(debugfile,"mailbox '%s' already registered as '%s'\n", buf, (*tmp)->path)); + break; +@@ -282,6 +329,7 @@ + else + (*tmp)->size = 0; + } ++ Incoming = buffy_sort(Incoming); + return 0; + } + +@@ -306,6 +354,11 @@ + return 0; + } + ++ if (option(OPTSIDEBAR) && mailbox->msg_unread > 0) { ++ mailbox->new = 1; ++ return 1; ++ } ++ + if ((dirp = opendir (path)) == NULL) + { + mailbox->magic = 0; +@@ -357,6 +410,73 @@ + + return 0; + } ++ ++/* update message counts for the sidebar */ ++void buffy_maildir_update (BUFFY* mailbox) ++{ ++ char path[_POSIX_PATH_MAX]; ++ DIR *dirp; ++ struct dirent *de; ++ char *p; ++ ++ if(!option(OPTSIDEBAR)) ++ return; ++ ++ mailbox->msgcount = 0; ++ mailbox->msg_unread = 0; ++ mailbox->msg_flagged = 0; ++ ++ snprintf (path, sizeof (path), "%s/new", mailbox->path); ++ ++ if ((dirp = opendir (path)) == NULL) ++ { ++ mailbox->magic = 0; ++ return; ++ } ++ ++ while ((de = readdir (dirp)) != NULL) ++ { ++ if (*de->d_name == '.') ++ continue; ++ ++ if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) { ++ mailbox->new = 1; ++ mailbox->msgcount++; ++ mailbox->msg_unread++; ++ } ++ } ++ ++ closedir (dirp); ++ snprintf (path, sizeof (path), "%s/cur", mailbox->path); ++ ++ if ((dirp = opendir (path)) == NULL) ++ { ++ mailbox->magic = 0; ++ return; ++ } ++ ++ while ((de = readdir (dirp)) != NULL) ++ { ++ if (*de->d_name == '.') ++ continue; ++ ++ if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) { ++ mailbox->msgcount++; ++ if ((p = strstr (de->d_name, ":2,"))) { ++ if (!strchr (p + 3, 'T')) { ++ if (!strchr (p + 3, 'S')) ++ mailbox->msg_unread++; ++ if (strchr(p + 3, 'F')) ++ mailbox->msg_flagged++; ++ } ++ } ++ } ++ } ++ ++ mailbox->sb_last_checked = time(NULL); ++ closedir (dirp); ++} ++ + /* returns 1 if mailbox has new mail */ + static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb) + { +@@ -368,7 +488,7 @@ + else + statcheck = sb->st_mtime > sb->st_atime + || (mailbox->newly_created && sb->st_ctime == sb->st_mtime && sb->st_ctime == sb->st_atime); +- if (statcheck) ++ if ((!option(OPTSIDEBAR) && statcheck) || (option(OPTSIDEBAR) && mailbox->msg_unread > 0)) + { + if (!option(OPTMAILCHECKRECENT) || sb->st_mtime > mailbox->last_visited) + { +@@ -388,6 +508,27 @@ + return rc; + } + ++/* update message counts for the sidebar */ ++void buffy_mbox_update (BUFFY* mailbox, struct stat *sb) ++{ ++ CONTEXT *ctx = NULL; ++ ++ if(!option(OPTSIDEBAR)) ++ return; ++ if(mailbox->sb_last_checked > sb->st_mtime && mailbox->msgcount != 0) ++ return; /* no check necessary */ ++ ++ ctx = mx_open_mailbox(mailbox->path, M_READONLY | M_QUIET | M_NOSORT | M_PEEK, NULL); ++ if(ctx) ++ { ++ mailbox->msgcount = ctx->msgcount; ++ mailbox->msg_unread = ctx->unread; ++ mailbox->msg_flagged = ctx->flagged; ++ mailbox->sb_last_checked = time(NULL); ++ mx_close_mailbox(ctx, 0); ++ } ++} ++ + int mutt_buffy_check (int force) + { + BUFFY *tmp; +@@ -461,17 +602,20 @@ + { + case M_MBOX: + case M_MMDF: ++ buffy_mbox_update (tmp, &sb); + if (buffy_mbox_hasnew (tmp, &sb) > 0) + BuffyCount++; + break; + + case M_MAILDIR: ++ buffy_maildir_update (tmp); + if (buffy_maildir_hasnew (tmp) > 0) + BuffyCount++; + break; + + case M_MH: +- mh_buffy(tmp); ++ mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged, &tmp->sb_last_checked); ++ mh_buffy(tmp); + if (tmp->new) + BuffyCount++; + break; *** mutt-1.5.23-orig/buffy.h 2014-03-12 11:03:44.000000000 -0500 --- mutt-1.5.23/buffy.h 2014-04-11 10:14:01.000000000 -0500 *************** @@ -300,19 +255,17 @@ diff -uNp -r mutt-1.5.22.orig/buffy.c mu } BUFFY; -*** mutt-1.5.23-orig/color.c 2014-03-12 11:03:45.000000000 -0500 ---- mutt-1.5.23/color.c 2014-04-11 10:14:01.000000000 -0500 -*************** -*** 93,98 **** ---- 93,100 ---- - { "bold", MT_COLOR_BOLD }, - { "underline", MT_COLOR_UNDERLINE }, - { "index", MT_COLOR_INDEX }, -+ { "sidebar_new", MT_COLOR_NEW }, -+ { "sidebar_flagged", MT_COLOR_FLAGGED }, - { NULL, 0 } - }; - +*** mutt-1.5.23-orig/color.c.orig 2015-08-30 19:06:38.000000000 +0200 +--- mutt-1.5.23/color.c 2015-09-10 09:34:06.000000000 +0200 +@@ -94,6 +94,8 @@ + { "underline", MT_COLOR_UNDERLINE }, + { "index", MT_COLOR_INDEX }, + { "prompt", MT_COLOR_PROMPT }, ++ { "sidebar_new", MT_COLOR_NEW }, ++ { "sidebar_flagged", MT_COLOR_FLAGGED }, + { NULL, 0 } + }; + *** mutt-1.5.23-orig/compose.c 2014-03-12 11:03:45.000000000 -0500 --- mutt-1.5.23/compose.c 2014-04-12 12:15:56.000000000 -0500 *************** @@ -785,84 +738,86 @@ diff -uNp -r mutt-1.5.22.orig/buffy.c mu #ifdef USE_IMAP WHERE short ImapKeepalive; WHERE short ImapPipelineDepth; -*** mutt-1.5.23-orig/handler.c 2014-03-12 11:03:45.000000000 -0500 ---- mutt-1.5.23/handler.c 2014-04-11 10:14:01.000000000 -0500 -*************** -*** 1599,1604 **** ---- 1599,1609 ---- - size_t tmplength = 0; - int rc = 0; - -+ #ifdef HAVE_FMEMOPEN -+ char *temp; -+ size_t tempsize; -+ #endif -+ - int oflags = s->flags; - - /* first determine which handler to use to process this part */ -*************** -*** 1711,1716 **** ---- 1716,1729 ---- - { - /* decode to a tempfile, saving the original destination */ - fp = s->fpout; -+ #ifdef HAVE_FMEMOPEN -+ if ((s->fpout = open_memstream(&temp, &tempsize)) == NULL) -+ { -+ mutt_error _("Unable to open memory stream!"); -+ dprint (1, (debugfile, "Can't open memory stream.\n")); -+ goto bail; -+ } -+ #else - mutt_mktemp (tempfile, sizeof (tempfile)); - if ((s->fpout = safe_fopen (tempfile, "w")) == NULL) - { -*************** -*** 1718,1723 **** ---- 1731,1737 ---- - dprint (1, (debugfile, "Can't open %s.\n", tempfile)); - goto bail; - } -+ #endif - /* decoding the attachment changes the size and offset, so save a copy - * of the "real" values now, and restore them after processing - */ -*************** -*** 1746,1753 **** ---- 1760,1778 ---- - /* restore final destination and substitute the tempfile for input */ - s->fpout = fp; - fp = s->fpin; -+ #ifdef HAVE_FMEMOPEN -+ if(tempsize) -+ s->fpin = fmemopen(temp, tempsize, "r"); -+ else /* fmemopen cannot handle zero-length buffers */ -+ s->fpin = safe_fopen ("/dev/null", "r"); -+ if(s->fpin == NULL) { -+ mutt_perror("failed to re-open memstream!"); -+ return (-1); -+ } -+ #else - s->fpin = fopen (tempfile, "r"); - unlink (tempfile); -+ #endif - - /* restore the prefix */ - s->prefix = savePrefix; -*************** -*** 1773,1778 **** ---- 1798,1807 ---- - - /* restore the original source stream */ - safe_fclose (&s->fpin); -+ #ifdef HAVE_FMEMOPEN -+ if(tempsize) -+ FREE(&temp); -+ #endif - s->fpin = fp; - } - } +*** mutt-1.5.23-orig/handler.c.orig 2015-09-10 09:34:53.000000000 +0200 +--- mutt-1.5.23/handler.c 2015-09-10 09:58:03.000000000 +0200 +@@ -1625,6 +1625,11 @@ + int decode = 0; + int rc = 0; + ++#ifdef HAVE_FMEMOPEN ++ char *temp; ++ size_t tempsize; ++#endif ++ + fseeko (s->fpin, b->offset, 0); + + /* see if we need to decode this part before processing it */ +@@ -1642,6 +1647,14 @@ + { + /* decode to a tempfile, saving the original destination */ + fp = s->fpout; ++#ifdef HAVE_FMEMOPEN ++ if ((s->fpout = open_memstream(&temp, &tempsize)) == NULL) ++ { ++ mutt_error _("Unable to open memory stream!"); ++ dprint (1, (debugfile, "Can't open memory stream.\n")); ++ goto bail; ++ } ++#else + mutt_mktemp (tempfile, sizeof (tempfile)); + if ((s->fpout = safe_fopen (tempfile, "w")) == NULL) + { +@@ -1649,6 +1662,7 @@ + dprint (1, (debugfile, "Can't open %s.\n", tempfile)); + return -1; + } ++#endif + /* decoding the attachment changes the size and offset, so save a copy + * of the "real" values now, and restore them after processing + */ +@@ -1677,8 +1691,19 @@ + /* restore final destination and substitute the tempfile for input */ + s->fpout = fp; + fp = s->fpin; ++#ifdef HAVE_FMEMOPEN ++ if(tempsize) ++ s->fpin = fmemopen(temp, tempsize, "r"); ++ else /* fmemopen cannot handle zero-length buffers */ ++ s->fpin = safe_fopen ("/dev/null", "r"); ++ if(s->fpin == NULL) { ++ mutt_perror("failed to re-open memstream!"); ++ return (-1); ++ } ++#else + s->fpin = fopen (tempfile, "r"); + unlink (tempfile); ++#endif + + /* restore the prefix */ + s->prefix = savePrefix; +@@ -1704,9 +1729,14 @@ + + /* restore the original source stream */ + safe_fclose (&s->fpin); ++#ifdef HAVE_FMEMOPEN ++ if(tempsize) ++ FREE(&temp); ++#endif + s->fpin = fp; + } + } ++ bail: + s->flags |= M_FIRSTDONE; + + return rc; +@@ -1743,6 +1773,7 @@ + handler_t handler = NULL; + int rc = 0; + ++ + int oflags = s->flags; + + /* first determine which handler to use to process this part */ *** mutt-1.5.23-orig/init.h 2014-03-12 11:06:17.000000000 -0500 --- mutt-1.5.23/init.h 2014-04-11 10:14:01.000000000 -0500 *************** @@ -1285,29 +1240,25 @@ diff -uNp -r mutt-1.5.22.orig/buffy.c mu static int mh_mkstemp (CONTEXT * dest, FILE ** fp, char **tgt) { int fd; -*** mutt-1.5.23-orig/mutt_curses.h 2014-03-12 11:03:45.000000000 -0500 ---- mutt-1.5.23/mutt_curses.h 2014-04-11 10:14:01.000000000 -0500 -*************** -*** 64,69 **** ---- 64,70 ---- - #undef lines - #endif /* lines */ - -+ #define CLEARLINE_WIN(x) move(x,SidebarWidth), clrtoeol() - #define CLEARLINE(x) move(x,0), clrtoeol() - #define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x) - #define BEEP() do { if (option (OPTBEEP)) beep(); } while (0) -*************** -*** 120,125 **** ---- 121,128 ---- - MT_COLOR_BOLD, - MT_COLOR_UNDERLINE, - MT_COLOR_INDEX, -+ MT_COLOR_NEW, -+ MT_COLOR_FLAGGED, - MT_COLOR_MAX - }; - +*** mutt-1.5.23-orig/mutt_curses.h.orig 2015-08-30 19:06:38.000000000 +0200 +--- mutt-1.5.23/mutt_curses.h 2015-09-10 09:42:34.000000000 +0200 +@@ -64,6 +64,7 @@ + #undef lines + #endif /* lines */ + ++#define CLEARLINE_WIN(x) move(x,SidebarWidth), clrtoeol() + #define CLEARLINE(x) move(x,0), clrtoeol() + #define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x) + #define BEEP() do { if (option (OPTBEEP)) beep(); } while (0) +@@ -121,6 +122,8 @@ + MT_COLOR_UNDERLINE, + MT_COLOR_INDEX, + MT_COLOR_PROMPT, ++ MT_COLOR_NEW, ++ MT_COLOR_FLAGGED, + MT_COLOR_MAX + }; + *** mutt-1.5.23-orig/mutt_menu.h 2014-03-12 11:06:17.000000000 -0500 --- mutt-1.5.23/mutt_menu.h 2014-04-11 10:14:01.000000000 -0500 *************** Modified: head/mail/mutt/files/extra-patch-sidebar-nntp ============================================================================== --- head/mail/mutt/files/extra-patch-sidebar-nntp Sun Sep 13 07:55:25 2015 (r396801) +++ head/mail/mutt/files/extra-patch-sidebar-nntp Sun Sep 13 09:18:09 2015 (r396802) @@ -1,281 +1,236 @@ Taken from http://lunar-linux.org/~tchan/mutt/patch-1.5.23.sidebar.20140412.txt diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c -*** mutt-1.5.23-orig/buffy.c 2014-03-12 11:03:44.000000000 -0500 ---- mutt-1.5.23/buffy.c 2014-04-12 15:33:54.000000000 -0500 -*************** -*** 161,166 **** ---- 161,209 ---- - } - } - -+ static int buffy_compare_name(const void *a, const void *b) { -+ const BUFFY *b1 = * (BUFFY * const *) a; -+ const BUFFY *b2 = * (BUFFY * const *) b; -+ -+ return mutt_strcoll(b1->path, b2->path); -+ } -+ -+ static BUFFY *buffy_sort(BUFFY *b) -+ { -+ BUFFY *tmp = b; -+ int buffycount = 0; -+ BUFFY **ary; -+ int i; -+ -+ if (!option(OPTSIDEBARSORT)) -+ return b; -+ -+ for (; tmp != NULL; tmp = tmp->next) -+ buffycount++; -+ -+ ary = (BUFFY **) safe_calloc(buffycount, sizeof (*ary)); -+ -+ tmp = b; -+ for (i = 0; tmp != NULL; tmp = tmp->next, i++) { -+ ary[i] = tmp; -+ } -+ -+ qsort(ary, buffycount, sizeof(*ary), buffy_compare_name); -+ -+ for (i = 0; i < buffycount - 1; i++) { -+ ary[i]->next = ary[i+1]; -+ } -+ ary[buffycount - 1]->next = NULL; -+ for (i = 1; i < buffycount; i++) { -+ ary[i]->prev = ary[i-1]; -+ } -+ ary[0]->prev = NULL; -+ -+ tmp = ary[0]; -+ free(ary); -+ return tmp; -+ } -+ - BUFFY *mutt_find_mailbox (const char *path) - { - BUFFY *tmp = NULL; -*************** -*** 196,204 **** ---- 239,251 ---- - static BUFFY *buffy_new (const char *path) - { - BUFFY* buffy; -+ char rp[PATH_MAX]; -+ char *r; - - buffy = (BUFFY *) safe_calloc (1, sizeof (BUFFY)); - strfcpy (buffy->path, path, sizeof (buffy->path)); -+ r = realpath(path, rp); -+ strfcpy (buffy->realpath, r ? rp : path, sizeof (buffy->realpath)); - buffy->next = NULL; - buffy->magic = 0; - -*************** -*** 243,250 **** - p = realpath (buf, f1); - for (tmp = &Incoming; *tmp; tmp = &((*tmp)->next)) - { -! q = realpath ((*tmp)->path, f2); -! if (mutt_strcmp (p ? p : buf, q ? q : (*tmp)->path) == 0) - { - dprint(3,(debugfile,"mailbox '%s' already registered as '%s'\n", buf, (*tmp)->path)); - break; ---- 290,297 ---- - p = realpath (buf, f1); - for (tmp = &Incoming; *tmp; tmp = &((*tmp)->next)) - { -! q = (*tmp)->realpath; -! if (mutt_strcmp (p ? p : buf, q) == 0) - { - dprint(3,(debugfile,"mailbox '%s' already registered as '%s'\n", buf, (*tmp)->path)); - break; -*************** -*** 282,287 **** ---- 329,335 ---- - else - (*tmp)->size = 0; - } -+ Incoming = buffy_sort(Incoming); - return 0; - } - -*************** -*** 306,311 **** ---- 354,364 ---- - return 0; - } - -+ if (option(OPTSIDEBAR) && mailbox->msg_unread > 0) { -+ mailbox->new = 1; -+ return 1; -+ } -+ - if ((dirp = opendir (path)) == NULL) - { - mailbox->magic = 0; -*************** -*** 340,345 **** ---- 393,464 ---- - return rc; - } - -+ /* update message counts for the sidebar */ -+ void buffy_maildir_update (BUFFY* mailbox) -+ { -+ char path[_POSIX_PATH_MAX]; -+ DIR *dirp; -+ struct dirent *de; -+ char *p; -+ -+ if(!option(OPTSIDEBAR)) -+ return; -+ -+ mailbox->msgcount = 0; -+ mailbox->msg_unread = 0; -+ mailbox->msg_flagged = 0; -+ -+ snprintf (path, sizeof (path), "%s/new", mailbox->path); -+ -+ if ((dirp = opendir (path)) == NULL) -+ { -+ mailbox->magic = 0; -+ return; -+ } -+ -+ while ((de = readdir (dirp)) != NULL) -+ { -+ if (*de->d_name == '.') -+ continue; -+ -+ if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) { -+ mailbox->new = 1; -+ mailbox->msgcount++; -+ mailbox->msg_unread++; -+ } -+ } -+ -+ closedir (dirp); -+ snprintf (path, sizeof (path), "%s/cur", mailbox->path); -+ *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***