mail/mailutils: update the port to version 3.15 (and slightly beyond)

Particularly, pull the necessary parts of three upstream patches to
fix some annoying regressions discovered after the release went gold.
While here, chase HTTP/1.1 301 Moved Permanently redirection in the
WWW line of the port description.

Prodded by:	maintainer
This commit is contained in:
Alexey Dokuchaev 2022-07-09 14:49:24 +00:00
parent 9a72bf7f4e
commit 42eb119b4a
9 changed files with 130 additions and 7 deletions

View file

@ -1,7 +1,7 @@
# Created by: Attila Nagy <bra@fsn.hu>
PORTNAME= mailutils
PORTVERSION= 3.13
PORTVERSION= 3.15
CATEGORIES= mail
MASTER_SITES= GNU GNU_ALPHA
@ -25,7 +25,7 @@ TEST_TARGET= check
CONFLICTS_INSTALL= avenger elm # bin/dotlock bin/frm
PLIST_SUB+= LIBVERSION=8.0.0 LIBSUFX=8 VERSION=${PORTVERSION}
PLIST_SUB+= LIBVERSION=9.0.0 LIBSUFX=9 VERSION=${PORTVERSION}
INFO= ${PORTNAME}
PORTDOCS= AUTHORS ChangeLog NEWS README* THANKS TODO

View file

@ -1,3 +1,3 @@
TIMESTAMP = 1628162648
SHA256 (mailutils-3.13.tar.xz) = d920971dcb49878a009911774fd6404f13d27bd101e2d59b664a28659a4094c7
SIZE (mailutils-3.13.tar.xz) = 3152892
TIMESTAMP = 1650221916
SHA256 (mailutils-3.15.tar.xz) = b7d0c286c352fcc7da7978cfd617cc66736b21fa891aa4f88855f516354f2ddb
SIZE (mailutils-3.15.tar.xz) = 3112212

View file

@ -0,0 +1,55 @@
--- libmailutils/stream/rdcache_stream.c.orig 2022-02-12 15:20:43 UTC
+++ libmailutils/stream/rdcache_stream.c
@@ -21,10 +21,9 @@
#include <stdlib.h>
#include <errno.h>
#include <mailutils/types.h>
+#include <mailutils/errno.h>
#include <mailutils/sys/rdcache_stream.h>
-size_t mu_rdcache_stream_max_memory_size = 4096;
-
static int
rdcache_read (struct _mu_stream *str, char *buf, size_t size, size_t *pnbytes)
{
@@ -38,7 +37,6 @@ rdcache_read (struct _mu_stream *str, char *buf, size_
if (status)
return status;
sp->offset += nbytes;
- sp->size += nbytes;
buf += nbytes;
size -= nbytes;
}
@@ -79,11 +77,29 @@ static int
}
static int
-rdcache_size (struct _mu_stream *str, off_t *psize)
+rdcache_size (struct _mu_stream *str, mu_off_t *psize)
{
struct _mu_rdcache_stream *sp = (struct _mu_rdcache_stream *) str;
- *psize = sp->size;
- return 0;
+ int rc;
+
+ if (mu_stream_eof (sp->transport))
+ {
+ *psize = sp->size;
+ rc = 0;
+ }
+ else
+ {
+ rc = mu_stream_size (sp->transport, psize);
+ switch (rc)
+ {
+ case EAGAIN:
+ case EINTR:
+ case ENOSYS:
+ case EINPROGRESS:
+ rc = MU_ERR_INFO_UNAVAILABLE;
+ }
+ }
+ return rc;
}
static int

View file

@ -0,0 +1,10 @@
--- libmailutils/stream/stream.c.orig 2022-02-12 15:20:43 UTC
+++ libmailutils/stream/stream.c
@@ -132,6 +132,7 @@ mu_stream_seterr (struct _mu_stream *stream, int code,
case EINTR:
case ENOSYS:
case EINPROGRESS:
+ case MU_ERR_INFO_UNAVAILABLE:
break;
default:

View file

@ -0,0 +1,14 @@
--- libmailutils/stream/streamcpy.c.orig 2022-02-12 15:20:43 UTC
+++ libmailutils/stream/streamcpy.c
@@ -55,7 +55,11 @@ mu_stream_copy_wcb (mu_stream_t dst, mu_stream_t src,
case 0:
break;
+ case EAGAIN:
+ case EINTR:
case ENOSYS:
+ case EINPROGRESS:
+ case MU_ERR_INFO_UNAVAILABLE:
size = 0;
break;

View file

@ -0,0 +1,17 @@
--- mh/folder.c.orig 2022-02-12 15:20:43 UTC
+++ mh/folder.c
@@ -806,6 +806,14 @@ action_pack (void)
mu_error (_("cannot read input mailbox: %s"), mu_strerror (errno));
return 1;
}
+
+ if (count == 0)
+ {
+ mu_mailbox_close (mbox);
+ mu_mailbox_destroy (&mbox);
+ return 0;
+ }
+
pack_tab = mu_calloc (count, sizeof pack_tab[0]); /* Never freed. No use to
try to. */

View file

@ -0,0 +1,24 @@
--- mh/msgchk.c.orig 2022-02-12 15:20:43 UTC
+++ mh/msgchk.c
@@ -274,12 +274,18 @@ checkmail (const char *username, int personal)
break;
default:
- if (rc != ENOSYS && rc != MU_ERR_INFO_UNAVAILABLE)
- mu_diag_funcall (MU_DIAG_ERROR, "mu_mailbox_messages_unseen",
- mu_url_to_string (url), rc);
+ mu_diag_funcall (MU_DIAG_ERROR, "mu_mailbox_messages_unseen",
+ mu_url_to_string (url), rc);
+ /* FALLTHROUGH */
+ case EAGAIN:
+ case EINTR:
+ case ENOSYS:
+ case EINPROGRESS:
+ case MU_ERR_INFO_UNAVAILABLE:
rc = mu_mailbox_messages_recent (mbox, &recent);
if (rc == 0)
newmail = recent > 0;
+ break;
}
if (rc)

View file

@ -7,4 +7,4 @@ format, ranging from standard Unix maildrops, through maildir and up to
remote mailboxes, which are transparently accessed using IMAP4, POP3,
and SMTP.
WWW: http://mailutils.org/
WWW: https://mailutils.org/

View file

@ -91,6 +91,7 @@ include/mailutils/md5.h
include/mailutils/message.h
include/mailutils/mh.h
include/mailutils/mime.h
include/mailutils/mimetypes.h
include/mailutils/monitor.h
include/mailutils/msgset.h
include/mailutils/mu_auth.h
@ -146,6 +147,7 @@ include/mailutils/sys/memory_stream.h
include/mailutils/sys/message.h
include/mailutils/sys/message_stream.h
include/mailutils/sys/mime.h
include/mailutils/sys/mimetypes.h
include/mailutils/sys/monitor.h
include/mailutils/sys/msgset.h
include/mailutils/sys/nullstream.h
@ -164,8 +166,8 @@ include/mailutils/sys/temp_file_stream.h
include/mailutils/sys/temp_stream.h
include/mailutils/sys/tls-stream.h
include/mailutils/sys/url.h
include/mailutils/sys/xscript-stream.h
include/mailutils/sys/wordsplit.h
include/mailutils/sys/xscript-stream.h
include/mailutils/syslog.h
include/mailutils/tls.h
include/mailutils/types.h
@ -355,6 +357,7 @@ share/aclocal/mailutils.m4
%%NLS%%share/locale/pt_BR/LC_MESSAGES/mailutils.mo
%%NLS%%share/locale/ro/LC_MESSAGES/mailutils.mo
%%NLS%%share/locale/ru/LC_MESSAGES/mailutils.mo
%%NLS%%share/locale/sr/LC_MESSAGES/mailutils.mo
%%NLS%%share/locale/sv/LC_MESSAGES/mailutils.mo
%%NLS%%share/locale/uk/LC_MESSAGES/mailutils.mo
%%NLS%%share/locale/vi/LC_MESSAGES/mailutils.mo