diff --git a/Mail-Box-IMAP4-3.007-Adapt-tests-to-Mail-Message-3.013.patch b/Mail-Box-IMAP4-3.007-Adapt-tests-to-Mail-Message-3.013.patch new file mode 100644 index 0000000..0624eaf --- /dev/null +++ b/Mail-Box-IMAP4-3.007-Adapt-tests-to-Mail-Message-3.013.patch @@ -0,0 +1,85 @@ +From 168ecffc014fc341853f8388ecc9cc1f02ec01f5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Thu, 3 Aug 2023 12:22:49 +0200 +Subject: [PATCH] Adapt tests to Mail-Message-3.013 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +After upgrading Mail-Message from 3.012 to 3.013, t/20server-fetch.t +fails like this: + + # Failed test '...body' + # at t/20server-fetch.t line 37. + # got: '("TEXT" "PLAIN" ("charset" "us-ascii") "" NIL "8BIT" 10 2) + # ' + # expected: '("TEXT" "PLAIN" ("charset" "utf-8") "" NIL "8BIT" 10 2) + # ' + +This is caused by an intentional change in Mail-Message which changed detection +of character set . + +This patch fixes the tests by explicitly setting the character set. + +CPAN RT#149119 + +Signed-off-by: Petr Písař +--- + t/20server-fetch.t | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +diff --git a/t/20server-fetch.t b/t/20server-fetch.t +index b8fb1b8..4ec7fca 100755 +--- a/t/20server-fetch.t ++++ b/t/20server-fetch.t +@@ -8,6 +8,7 @@ use warnings; + use Mail::Box::Test; + use Mail::Message; + use Mail::Message::Body::Lines; ++use Mail::Message::Head::Complete; + use Mail::Server::IMAP4::Fetch; + + use Test::More tests => 44; +@@ -20,6 +21,7 @@ my $msg = Mail::Message->build + , Date => 'now' + , Subject => 'Life of Brian' + , 'Message-ID' => 'unique' ++ , 'Content-Type' => 'text/plain; charset="utf-8"' + + , data => [ "two\n", "lines\n" ] + ); +@@ -51,20 +53,28 @@ __ENVELOPE + # + + my $data = Mail::Message::Body::Lines->new ++ ( mime_type => 'text/plain' ++ , charset => 'utf-8' ++ , data => [ "two\n", "lines\n" ] ++ ); ++ ++my $attach = Mail::Message::Body::Lines->new + ( mime_type => 'audio/mpeg3' + , transfer_encoding => 'base64' + , charset => 'utf8' + , data => "ABBA\n" + ); + +-my $mp = Mail::Message->build ++my $head = Mail::Message::Head::Complete->build + ( From => 'me' + , Date => 'now' + , Subject => 'multi' + , 'Message-ID' => 'unique' ++ ); + +- , data => [ "two\n", "lines\n" ] +- , attach => $data ++my $mp = Mail::Message->new ++ ( head => $head ++ , body => $data->attach($attach) + ); + + ok(defined $mp, "Simple multipart"); +-- +2.41.0 + diff --git a/perl-Mail-Box-IMAP4.spec b/perl-Mail-Box-IMAP4.spec index 7e9103d..9107c7e 100644 --- a/perl-Mail-Box-IMAP4.spec +++ b/perl-Mail-Box-IMAP4.spec @@ -1,10 +1,13 @@ Name: perl-Mail-Box-IMAP4 Version: 3.007 -Release: 13%{?dist} +Release: 14%{?dist} Summary: Handle IMAP4 folders as client License: GPL-1.0-or-later OR Artistic-1.0-Perl URL: https://metacpan.org/release/Mail-Box-IMAP4 Source0: https://cpan.metacpan.org/authors/id/M/MA/MARKOV/Mail-Box-IMAP4-%{version}.tar.gz +# Adapt tests to Mail-Message-3.013, bug #2225452, CPAN RT#149119, +# proposed to the upstream. +Patch0: Mail-Box-IMAP4-3.007-Adapt-tests-to-Mail-Message-3.013.patch BuildArch: noarch # Build BuildRequires: make @@ -80,7 +83,7 @@ needed to implement a full IMAP4 server. The server implementation is not completed. %prep -%setup -q -n Mail-Box-IMAP4-%{version} +%autosetup -p1 -n Mail-Box-IMAP4-%{version} %build perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 @@ -105,6 +108,9 @@ make test %{_mandir}/man3/Mail::Server* %changelog +* Thu Aug 03 2023 Petr Pisar - 3.007-14 +- Adapt tests to Mail-Message-3.013 (bug #2225452) + * Thu Jul 20 2023 Fedora Release Engineering - 3.007-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild