Sat Oct 29 14:44:07 2022 UTC ()
mail/cyrus-imapd24: fix issue related to own assert() definition.

The C standard says assert() must be a void expression, so change
the definition from being a block to an expression, loosely patterned
after our <assert.h> header.  This makes it compatible with the
various perl headers this program uses.  Also, add a missing semicolon
in a sequence of assert() uses, as this error was now exposed.

Bump PKGREVISION.


(he)
diff -r1.77 -r1.78 pkgsrc/mail/cyrus-imapd24/Makefile
diff -r1.29 -r1.30 pkgsrc/mail/cyrus-imapd24/distinfo
diff -r1.3 -r1.4 pkgsrc/mail/cyrus-imapd24/patches/patch-imap_mailbox.c
diff -r0 -r1.1 pkgsrc/mail/cyrus-imapd24/patches/patch-lib_assert.h

cvs diff -r1.77 -r1.78 pkgsrc/mail/cyrus-imapd24/Makefile (expand / switch to unified diff)

--- pkgsrc/mail/cyrus-imapd24/Makefile 2022/06/28 11:34:19 1.77
+++ pkgsrc/mail/cyrus-imapd24/Makefile 2022/10/29 14:44:07 1.78
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1# $NetBSD: Makefile,v 1.77 2022/06/28 11:34:19 wiz Exp $ 1# $NetBSD: Makefile,v 1.78 2022/10/29 14:44:07 he Exp $
2 2
3DISTNAME= cyrus-imapd-2.4.20 3DISTNAME= cyrus-imapd-2.4.20
4PKGREVISION= 20 4PKGREVISION= 21
5CATEGORIES= mail 5CATEGORIES= mail
6MASTER_SITES= http://cyrusimap.org/releases/ 6MASTER_SITES= http://cyrusimap.org/releases/
7MASTER_SITES+= https://www.cyrusimap.org/releases/old/ 7MASTER_SITES+= https://www.cyrusimap.org/releases/old/
8 8
9MAINTAINER= pkgsrc-users@NetBSD.org 9MAINTAINER= pkgsrc-users@NetBSD.org
10HOMEPAGE= https://www.cyrusimap.org/ 10HOMEPAGE= https://www.cyrusimap.org/
11COMMENT= Cyrus IMAP server 11COMMENT= Cyrus IMAP server
12#LICENSE= original-bsd # like license 12#LICENSE= original-bsd # like license
13 13
14MAKE_JOBS_SAFE= no 14MAKE_JOBS_SAFE= no
15 15
16USE_TOOLS+= perl:run makedepend 16USE_TOOLS+= perl:run makedepend
17USE_PKGLOCALEDIR= yes 17USE_PKGLOCALEDIR= yes

cvs diff -r1.29 -r1.30 pkgsrc/mail/cyrus-imapd24/distinfo (expand / switch to unified diff)

--- pkgsrc/mail/cyrus-imapd24/distinfo 2022/05/29 19:53:59 1.29
+++ pkgsrc/mail/cyrus-imapd24/distinfo 2022/10/29 14:44:07 1.30
@@ -1,21 +1,22 @@ @@ -1,21 +1,22 @@
1$NetBSD: distinfo,v 1.29 2022/05/29 19:53:59 gavan Exp $ 1$NetBSD: distinfo,v 1.30 2022/10/29 14:44:07 he Exp $
2 2
3BLAKE2s (cyrus-imapd-2.4.20.tar.gz) = fca8c0a2a00abc61bd61c0b563b36403c843fa0f25e35432692394531da8b158 3BLAKE2s (cyrus-imapd-2.4.20.tar.gz) = fca8c0a2a00abc61bd61c0b563b36403c843fa0f25e35432692394531da8b158
4SHA512 (cyrus-imapd-2.4.20.tar.gz) = a1e7d8b4bc096c57ba36f74f2853eb520503b40beffc80912a0c081bce1df3fa8cd41b00c789d33097be6325563743c9540c11cc6137c51a747880749d2f5b4d 4SHA512 (cyrus-imapd-2.4.20.tar.gz) = a1e7d8b4bc096c57ba36f74f2853eb520503b40beffc80912a0c081bce1df3fa8cd41b00c789d33097be6325563743c9540c11cc6137c51a747880749d2f5b4d
5Size (cyrus-imapd-2.4.20.tar.gz) = 2488878 bytes 5Size (cyrus-imapd-2.4.20.tar.gz) = 2488878 bytes
6SHA1 (patch-ac) = d2b973789361e946713577387f1a770b1dd1f96d 6SHA1 (patch-ac) = d2b973789361e946713577387f1a770b1dd1f96d
7SHA1 (patch-ah) = 4bc62dfdeafdca83ddac02aff0ffd05db28fe0b9 7SHA1 (patch-ah) = 4bc62dfdeafdca83ddac02aff0ffd05db28fe0b9
8SHA1 (patch-ai) = 9167678988f411479d187b232eb10ad8622b4151 8SHA1 (patch-ai) = 9167678988f411479d187b232eb10ad8622b4151
9SHA1 (patch-am) = e100e13d5137116f5bd7674e954031b2615e5ab1 9SHA1 (patch-am) = e100e13d5137116f5bd7674e954031b2615e5ab1
10SHA1 (patch-ao) = c01c9d32b4d73cbc32d2ad8bfca8b8b021ca2474 10SHA1 (patch-ao) = c01c9d32b4d73cbc32d2ad8bfca8b8b021ca2474
11SHA1 (patch-aq) = 101f5d253dae303f187e15eca28aa687f846ba6b 11SHA1 (patch-aq) = 101f5d253dae303f187e15eca28aa687f846ba6b
12SHA1 (patch-configure) = 2b4ea2203f446175fedfe2549534f382e4115579 12SHA1 (patch-configure) = 2b4ea2203f446175fedfe2549534f382e4115579
13SHA1 (patch-imap_idlemsg.c) = 112e8077e1f820d526db342f425dab3ba15e71f2 13SHA1 (patch-imap_idlemsg.c) = 112e8077e1f820d526db342f425dab3ba15e71f2
14SHA1 (patch-imap_mailbox.c) = 9a000763a153863f6c40f8939fe19eab41973cea 14SHA1 (patch-imap_mailbox.c) = 53cab0f89e2d64424871d214f7cdd4213388dcfb
15SHA1 (patch-imtest_Makefile.in) = c76d63144a30ea28af12474376451c9e3288be2b 15SHA1 (patch-imtest_Makefile.in) = c76d63144a30ea28af12474376451c9e3288be2b
16SHA1 (patch-lib_Makefile.in) = a337c7dc7c22a25d029c4b4d8c7c8b5650bff8f2 16SHA1 (patch-lib_Makefile.in) = a337c7dc7c22a25d029c4b4d8c7c8b5650bff8f2
 17SHA1 (patch-lib_assert.h) = 027a9f6c20ceffee0651dc38f1666d5a307e1ce4
17SHA1 (patch-master_Makefile.in) = ec274fab36541e2c03572e72c6ff8e05f24756ef 18SHA1 (patch-master_Makefile.in) = ec274fab36541e2c03572e72c6ff8e05f24756ef
18SHA1 (patch-notifyd_Makefile.in) = e66b93338f8fc1713be3ff14ba1edad005cb428b 19SHA1 (patch-notifyd_Makefile.in) = e66b93338f8fc1713be3ff14ba1edad005cb428b
19SHA1 (patch-perl_sieve_lib_Makefile.in) = a2b9ee49c0d01262d04175498122cbf14d92cc6f 20SHA1 (patch-perl_sieve_lib_Makefile.in) = a2b9ee49c0d01262d04175498122cbf14d92cc6f
20SHA1 (patch-sieve_Makefile.in) = 2f802fa3066c42235ff62fefb648c03dff0516b8 21SHA1 (patch-sieve_Makefile.in) = 2f802fa3066c42235ff62fefb648c03dff0516b8
21SHA1 (patch-timsieved_Makefile.in) = 9d9717d2346517f3d89c24ef667bd8c650bf60a2 22SHA1 (patch-timsieved_Makefile.in) = 9d9717d2346517f3d89c24ef667bd8c650bf60a2

cvs diff -r1.3 -r1.4 pkgsrc/mail/cyrus-imapd24/patches/patch-imap_mailbox.c (expand / switch to unified diff)

--- pkgsrc/mail/cyrus-imapd24/patches/patch-imap_mailbox.c 2014/06/17 01:08:59 1.3
+++ pkgsrc/mail/cyrus-imapd24/patches/patch-imap_mailbox.c 2022/10/29 14:44:07 1.4
@@ -1,21 +1,31 @@ @@ -1,21 +1,31 @@
1$NetBSD: patch-imap_mailbox.c,v 1.3 2014/06/17 01:08:59 obache Exp $ 1$NetBSD: patch-imap_mailbox.c,v 1.4 2022/10/29 14:44:07 he Exp $
2 2
3* cast to unsigned long for platform sizeof(time_t) > sizeof(unsigned long). 3* cast to unsigned long for platform sizeof(time_t) > sizeof(unsigned long).
4 https://bugzilla.cyrusimap.org/show_bug.cgi?id=3376 4 https://bugzilla.cyrusimap.org/show_bug.cgi?id=3376
 5* Fix an issue related to use of the assert() macro (statement or block?)
5 6
6--- imap/mailbox.c.orig 2012-12-01 19:57:54.000000000 +0000 7--- imap/mailbox.c.orig 2012-12-01 19:57:54.000000000 +0000
7+++ imap/mailbox.c 8+++ imap/mailbox.c
8@@ -1960,10 +1960,10 @@ bit32 make_sync_crc(struct mailbox *mail 9@@ -1961,10 +1961,10 @@ bit32 make_sync_crc(struct mailbox *mail
9 flagcrc ^= crc32_cstring(buf); 10 flagcrc ^= crc32_cstring(buf);
10 } 11 }
11  12
12- snprintf(buf, 4096, "%u " MODSEQ_FMT " %lu (%u) %lu %s", 13- snprintf(buf, 4096, "%u " MODSEQ_FMT " %lu (%u) %lu %s",
13- record->uid, record->modseq, record->last_updated, 14- record->uid, record->modseq, record->last_updated,
14+ snprintf(buf, 4096, "%u " MODSEQ_FMT " " MODSEQ_FMT " (%u) " MODSEQ_FMT " %s", 15+ snprintf(buf, 4096, "%u " MODSEQ_FMT " " MODSEQ_FMT " (%u) " MODSEQ_FMT " %s",
15+ record->uid, record->modseq, (modseq_t)record->last_updated, 16+ record->uid, record->modseq, (modseq_t)record->last_updated,
16 flagcrc, 17 flagcrc,
17- record->internaldate, 18- record->internaldate,
18+ (modseq_t)record->internaldate, 19+ (modseq_t)record->internaldate,
19 message_guid_encode(&record->guid)); 20 message_guid_encode(&record->guid));
20  21
21 return crc32_cstring(buf); 22 return crc32_cstring(buf);
 23@@ -2179,7 +2179,7 @@ int mailbox_append_index_record(struct m
 24 assert(mailbox_index_islocked(mailbox, 1));
 25
 26 /* Append MUST be a higher UID than any we've yet seen */
 27- assert(record->uid > mailbox->i.last_uid)
 28+ assert(record->uid > mailbox->i.last_uid);
 29
 30 /* Append MUST have a message with data */
 31 assert(record->size);

File Added: pkgsrc/mail/cyrus-imapd24/patches/patch-lib_assert.h
$NetBSD: patch-lib_assert.h,v 1.1 2022/10/29 14:44:07 he Exp $

Fix assert() macro to be usable as an expression.

--- lib/assert.h.orig	2017-08-18 00:29:14.000000000 +0000
+++ lib/assert.h
@@ -46,10 +46,10 @@
 #define INCLUDED_ASSERT_H
 
 #ifdef __STDC__
-#define assert(ex)	{if (!(ex))assertionfailed(__FILE__, __LINE__, #ex);}
+#define assert(ex)	((ex) ? (void)0 : assertionfailed(__FILE__, __LINE__, #ex))
 void assertionfailed(const char *file, int line, const char *expr);
 #else
-#define assert(ex)	{if (!(ex))assertionfailed(__FILE__, __LINE__, (char*)0);}
+#define assert(ex)	((ex) ? (void)0 : assertionfailed(__FILE__, __LINE__, (char*)0))
 #endif
 
 #endif /* INCLUDED_ASSERT_H */