commit:     81d46f09ae52c28b091e830cb86d2e8ae116fec8
Author:     Eray Aslan <eras <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  8 10:11:26 2025 +0000
Commit:     Eray Aslan <eras <AT> gentoo <DOT> org>
CommitDate: Wed Jan  8 10:11:26 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=81d46f09

net-mail/mailutils: use the official patch for mbox testing

Signed-off-by: Eray Aslan <eras <AT> gentoo.org>

 .../files/mailutils-skip-mbox-tests.patch          |  60 -----------
 .../mailutils/files/mailutils-tests-use-mbox.patch | 119 +++++++++++++++++++++
 net-mail/mailutils/mailutils-3.18.ebuild           |   2 +-
 3 files changed, 120 insertions(+), 61 deletions(-)

diff --git a/net-mail/mailutils/files/mailutils-skip-mbox-tests.patch 
b/net-mail/mailutils/files/mailutils-skip-mbox-tests.patch
deleted file mode 100644
index 1443e66ecce1..000000000000
--- a/net-mail/mailutils/files/mailutils-skip-mbox-tests.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-diff --git a/mail/testsuite/mail/Followup.exp 
b/mail/testsuite/mail/Followup.exp
-index c9f9d11..a7927e9 100644
---- a/mail/testsuite/mail/Followup.exp
-+++ b/mail/testsuite/mail/Followup.exp
-@@ -17,7 +17,9 @@
- 
- mail_version
- 
--if ![mu_check_capability ENABLE_SENDMAIL] {
-+if { [mu_check_capability SCHEME] == "maildir" } {
-+    unsupported "Does not work when default mailbox type is maildir"
-+} elseif ![mu_check_capability ENABLE_SENDMAIL] {
-     unsupported "Support for sendmail not compiled in"
- } else {
-     mail_start "--file=%teaparty.mbox" \
-diff --git a/mail/testsuite/mail/Reply.exp b/mail/testsuite/mail/Reply.exp
-index c492aee..543a857 100644
---- a/mail/testsuite/mail/Reply.exp
-+++ b/mail/testsuite/mail/Reply.exp
-@@ -17,7 +17,9 @@
- 
- mail_version
- 
--if ![mu_check_capability ENABLE_SENDMAIL] {
-+if { [mu_check_capability SCHEME] == "maildir" } {
-+    unsupported "Does not work when default mailbox type is maildir"
-+} elseif ![mu_check_capability ENABLE_SENDMAIL] {
-     unsupported "Support for sendmail not compiled in"
- } else {
-     mail_start "--file=%teaparty.mbox" \
-diff --git a/mail/testsuite/mail/followup.exp 
b/mail/testsuite/mail/followup.exp
-index ca15317..ce042b5 100644
---- a/mail/testsuite/mail/followup.exp
-+++ b/mail/testsuite/mail/followup.exp
-@@ -17,7 +17,9 @@
- 
- mail_version
- 
--if ![mu_check_capability ENABLE_SENDMAIL] {
-+if { [mu_check_capability SCHEME] == "maildir" } {
-+    unsupported "Does not work when default mailbox type is maildir"
-+} elseif ![mu_check_capability ENABLE_SENDMAIL] {
-     unsupported "Support for sendmail not compiled in"
- } else {
-     mail_start "--file=%teaparty.mbox" \
-diff --git a/mail/testsuite/mail/reply.exp b/mail/testsuite/mail/reply.exp
-index 8d66e99..7b178b3 100644
---- a/mail/testsuite/mail/reply.exp
-+++ b/mail/testsuite/mail/reply.exp
-@@ -17,7 +17,9 @@
- 
- mail_version
- 
--if ![mu_check_capability ENABLE_SENDMAIL] {
-+if { [mu_check_capability SCHEME] == "maildir" } {
-+    unsupported "Does not work when default mailbox type is maildir"
-+} elseif ![mu_check_capability ENABLE_SENDMAIL] {
-     unsupported "Support for sendmail not compiled in"
- } else {
-     mail_start "--file=%teaparty.mbox" \

diff --git a/net-mail/mailutils/files/mailutils-tests-use-mbox.patch 
b/net-mail/mailutils/files/mailutils-tests-use-mbox.patch
new file mode 100644
index 000000000000..0710b880a196
--- /dev/null
+++ b/net-mail/mailutils/files/mailutils-tests-use-mbox.patch
@@ -0,0 +1,119 @@
+From e5ae56618dc2a15b9cff792be7315185bbd96ad2 Mon Sep 17 00:00:00 2001
+From: Sergey Poznyakoff <[email protected]>
+Date: Tue, 7 Jan 2025 11:59:33 +0200
+Subject: Fix testsuite (mda & mail) to work with arbitrary default mailbox
+ type
+
+* mail/testsuite/lib/mail.exp (default_mail_start): Force mbox
+mailbox type.
+* mda/mda/tests/forward.at: Likewise.
+* mda/mda/tests/mda.at: Likewise.
+* mda/tests/mda.sh (dumpmail): Handle only mbox.
+---
+ mail/testsuite/lib/mail.exp |  2 ++
+ mda/mda/tests/forward.at    |  2 +-
+ mda/mda/tests/mda.at        | 16 +---------------
+ mda/tests/mda.sh            | 26 --------------------------
+ 4 files changed, 4 insertions(+), 42 deletions(-)
+
+diff --git a/mail/testsuite/lib/mail.exp b/mail/testsuite/lib/mail.exp
+index b7e68b2..9034d57 100644
+--- a/mail/testsuite/lib/mail.exp
++++ b/mail/testsuite/lib/mail.exp
+@@ -51,6 +51,8 @@ proc default_mail_start {args} {
+       append sw $MU_TOOL_FLAGS
+     }
+     
++    append sw " --set mailbox.mailbox-type=mbox"
++
+     if [info exists host_board] {
+       if [board_info $host_board exists top_srcdir] {
+           append sw " --set \"mailbox.mail-spool='[board_info $host_board 
top_srcdir]/mail/testsuite/spool'\""
+diff --git a/mda/mda/tests/forward.at b/mda/mda/tests/forward.at
+index 08d22ac..d4af639 100644
+--- a/mda/mda/tests/forward.at
++++ b/mda/mda/tests/forward.at
+@@ -19,7 +19,7 @@ AT_KEYWORDS([maidag forward])
+ 
+ m4_pushdef([TESTMDA_CONF],[cat > testmda.conf <<EOF
+ mailbox {
+-  mailbox-pattern "$(pwd)/spool/\${user}";
++  mailbox-pattern "mbox://$(pwd)/spool/\${user}";
+ }  
+ 
+ mailer {
+diff --git a/mda/mda/tests/mda.at b/mda/mda/tests/mda.at
+index b101ae0..5279f15 100644
+--- a/mda/mda/tests/mda.at
++++ b/mda/mda/tests/mda.at
+@@ -16,7 +16,7 @@
+ 
+ m4_pushdef([TESTMDA_CONF],[cat > testmda.conf <<EOF
+ mailbox {
+-  mailbox-pattern "$(pwd)/spool/\${user}";
++  mailbox-pattern "mbox://$(pwd)/spool/\${user}";
+ }  
+ EOF
+ ])
+@@ -52,20 +52,6 @@ mkdir spool
+ TESTMDA_CONF
+ testmda  --from [email protected] root < msg || exit $?
+ dumpmail spool/root
+-case $MU_DEFAULT_SCHEME in
+-mbox)
+-    head -1 spool/root
+-    echo "$envelope" >> expout
+-    ;;
+-mh)    
+-    sed -n -e '/^X-Envelope-Date: */s///p' spool/root/1
+-    echo "$date" >> expout
+-    ;;
+-maildir)
+-    sed -n -e '/^X-Envelope-Date: */s///p' $(find spool/root/new -type f | 
head -n 1)
+-    echo "$date" >> expout
+-    ;;
+-esac
+ ],
+ [0],
+ [expout])
+diff --git a/mda/tests/mda.sh b/mda/tests/mda.sh
+index 208602a..90a8d6c 100644
+--- a/mda/tests/mda.sh
++++ b/mda/tests/mda.sh
+@@ -16,33 +16,7 @@
+ 
+ INPUT_MSG=$abs_top_srcdir/mda/tests/input.msg
+ dumpmail() {
+-    case $MU_DEFAULT_SCHEME in
+-      mbox)
+           sed -e '/^From /d'\
+               -e /^X-IMAPbase:/d\
+                 -e /^X-UID:/d $1
+-          ;;
+-      dotmail)
+-          sed -e '/^\.$/d'\
+-              -e /^X-IMAPbase:/d\
+-                -e /^X-UID:/d $1
+-          ;;
+-      mh)
+-          sed -e /^X-IMAPbase:/d\
+-                -e /^X-UID:/d\
+-                -e /^X-Envelope-Sender:/d\
+-                -e /^X-Envelope-Date:/d $1/1
+-          ;;
+-      maildir)
+-          f=$(find $1/new -type f | head -n 1)
+-          if test -n $f; then
+-              sed -e /^X-IMAPbase:/d\
+-                    -e /^X-UID:/d\
+-                    -e /^X-Envelope-Sender:/d\
+-                    -e /^X-Envelope-Date:/d $f
+-          fi
+-          ;;
+-      *)  # Should not happen
+-          echo >&2 "Default mailbox format is uknown"
+-    esac
+ }    
+-- 
+cgit v1.1
+

diff --git a/net-mail/mailutils/mailutils-3.18.ebuild 
b/net-mail/mailutils/mailutils-3.18.ebuild
index 3f9ac446c933..45199633d8cc 100644
--- a/net-mail/mailutils/mailutils-3.18.ebuild
+++ b/net-mail/mailutils/mailutils-3.18.ebuild
@@ -63,7 +63,7 @@ REQUIRED_USE="
 DOCS=( ABOUT-NLS AUTHORS COPYING COPYING.LESSER ChangeLog INSTALL NEWS README 
THANKS TODO )
 PATCHES=(
        "${FILESDIR}"/${PN}-3.5-add-include.patch
-       "${FILESDIR}"/${PN}-skip-mbox-tests.patch
+       "${FILESDIR}"/${PN}-tests-use-mbox.patch
 )
 
 pkg_setup() {

Reply via email to