Gentoo Archives: gentoo-commits

From: Kent Fredric <kentnl@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-perl/Convert-PEM/files/, dev-perl/Convert-PEM/
Date: Mon, 02 Oct 2017 16:13:24
Message-Id: 1506960745.ad0a949482b82e580f22114f7b0c4396b4b29500.kentnl@gentoo
1 commit: ad0a949482b82e580f22114f7b0c4396b4b29500
2 Author: Kent Fredric <kentnl <AT> gentoo <DOT> org>
3 AuthorDate: Mon Oct 2 16:09:03 2017 +0000
4 Commit: Kent Fredric <kentnl <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 2 16:12:25 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad0a9494
7
8 dev-perl/Convert-PEM: Fix random test failures bug #625652
9
10 Also:
11 - Migrate Module::Install sed to a patch
12 - Fix Test::Builder warnings
13
14 Closes: https://bugs.gentoo.org/625652
15 Package-Manager: Portage-2.3.8, Repoman-2.3.3
16
17 dev-perl/Convert-PEM/Convert-PEM-0.80.0-r1.ebuild | 11 ++--
18 .../Convert-PEM/files/Convert-PEM-0.80.0-526.patch | 23 +++++++
19 .../files/Convert-PEM-0.80.0-decryptiontest.patch | 70 ++++++++++++++++++++++
20 .../files/Convert-PEM-0.80.0-testbuilder.patch | 29 +++++++++
21 4 files changed, 127 insertions(+), 6 deletions(-)
22
23 diff --git a/dev-perl/Convert-PEM/Convert-PEM-0.80.0-r1.ebuild b/dev-perl/Convert-PEM/Convert-PEM-0.80.0-r1.ebuild
24 index b62dc7538e2..469ab38663d 100644
25 --- a/dev-perl/Convert-PEM/Convert-PEM-0.80.0-r1.ebuild
26 +++ b/dev-perl/Convert-PEM/Convert-PEM-0.80.0-r1.ebuild
27 @@ -21,11 +21,10 @@ RDEPEND="
28 virtual/perl-MIME-Base64
29 "
30 DEPEND="${RDEPEND}"
31 +PATCHES=(
32 + "${FILESDIR}/${P}-526.patch"
33 + "${FILESDIR}/${P}-decryptiontest.patch"
34 + "${FILESDIR}/${P}-testbuilder.patch"
35 +)
36
37 SRC_TEST=do
38 -
39 -src_prepare() {
40 - sed -i -e 's/use inc::Module::Install;/use lib q[.]; use inc::Module::Install;/' Makefile.PL ||
41 - die "Can't patch Makefile.PL for 5.26 dot-in-inc"
42 - perl-module_src_prepare
43 -}
44
45 diff --git a/dev-perl/Convert-PEM/files/Convert-PEM-0.80.0-526.patch b/dev-perl/Convert-PEM/files/Convert-PEM-0.80.0-526.patch
46 new file mode 100644
47 index 00000000000..49c74e5e688
48 --- /dev/null
49 +++ b/dev-perl/Convert-PEM/files/Convert-PEM-0.80.0-526.patch
50 @@ -0,0 +1,23 @@
51 +From 22b4a18d00c7080972341db2052041448391fbfe Mon Sep 17 00:00:00 2001
52 +From: Kent Fredric <kentnl@g.o>
53 +Date: Sun, 11 Jun 2017 14:42:41 +1200
54 +Subject: Fix Makefile.PL for Perl 5.26 w/o "." in @INC
55 +
56 +Bug: https://bugs.gentoo.org/613632
57 +Bug: https://rt.cpan.org/Ticket/Display.html?id=120714
58 +---
59 + Makefile.PL | 1 +
60 + 1 file changed, 1 insertion(+)
61 +
62 +diff --git a/Makefile.PL b/Makefile.PL
63 +index 8d4d686..3e87348 100644
64 +--- a/Makefile.PL
65 ++++ b/Makefile.PL
66 +@@ -1,3 +1,4 @@
67 ++use lib '.';
68 + use inc::Module::Install;
69 + name 'Convert-PEM';
70 + all_from 'lib/Convert/PEM.pm';
71 +--
72 +2.14.1
73 +
74
75 diff --git a/dev-perl/Convert-PEM/files/Convert-PEM-0.80.0-decryptiontest.patch b/dev-perl/Convert-PEM/files/Convert-PEM-0.80.0-decryptiontest.patch
76 new file mode 100644
77 index 00000000000..3fac17d111d
78 --- /dev/null
79 +++ b/dev-perl/Convert-PEM/files/Convert-PEM-0.80.0-decryptiontest.patch
80 @@ -0,0 +1,70 @@
81 +From 9b8f76ece49348cfdc50c5e3b4098694e07184d6 Mon Sep 17 00:00:00 2001
82 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@××××××.com>
83 +Date: Fri, 5 Sep 2014 11:04:30 +0200
84 +Subject: Do not test the reason for decryption failure on bad key
85 +MIME-Version: 1.0
86 +Content-Type: text/plain; charset=UTF-8
87 +Content-Transfer-Encoding: 8bit
88 +
89 +Tests checking error message after using bad decryption key fails
90 +randomly.
91 +
92 +Some bad keys can fool the "Bad key/passphrase" heuristic in the
93 +Convert::PEM::CBC::decode() because it's a feature a stream cipher to
94 +spit out bad output on bad key. So the heuristic is just a kind
95 +service to point to the cause of the decoding failure (i.e. bad key).
96 +By probabilistic nature of the heuristic, we cannot rely on the
97 +/^Decryption failed/ error message.
98 +
99 +This patch removes these tests.
100 +
101 +Bug: https://rt.cpan.org/Ticket/Display.html?id=27574
102 +Bug: https://bugs.gentoo.org/625652
103 +
104 +Signed-off-by: Petr Písař <ppisar@××××××.com>
105 +---
106 + t/01-readwrite.t | 3 +--
107 + t/02-encode.t | 3 +--
108 + 2 files changed, 2 insertions(+), 4 deletions(-)
109 +
110 +diff --git a/t/01-readwrite.t b/t/01-readwrite.t
111 +index 42a4416..208eba1 100644
112 +--- a/t/01-readwrite.t
113 ++++ b/t/01-readwrite.t
114 +@@ -1,5 +1,5 @@
115 + use strict;
116 +-use Test::More tests => 16;
117 ++use Test::More tests => 15;
118 + use Test::Exception;
119 +
120 + use Convert::PEM;
121 +@@ -29,7 +29,6 @@ lives_ok { $pem->write( Filename => $objfile, Content => $obj, Password => 'xx'
122 + ok -e $objfile, 'output file exists';
123 + lives_ok { $obj2 = $pem->read( Filename => $objfile ) } 'can read';
124 + ok !defined $obj2, 'cannot read encrypted file';
125 +-like $pem->errstr, qr/^Decryption failed/, 'errstr matches decryption failed';
126 + lives_ok { $obj2 = $pem->read( Filename => $objfile, Password => 'xx') } 'can read';
127 + is $obj->{TestObject}{int}, $obj2->{TestObject}{int}, 'input matches output';
128 + unlink $objfile;
129 +diff --git a/t/02-encode.t b/t/02-encode.t
130 +index 37aa987..9c6ab4c 100644
131 +--- a/t/02-encode.t
132 ++++ b/t/02-encode.t
133 +@@ -1,5 +1,5 @@
134 + use strict;
135 +-use Test::More tests => 9;
136 ++use Test::More tests => 8;
137 +
138 + use Convert::PEM;
139 + use Math::BigInt;
140 +@@ -25,7 +25,6 @@ $blob = $pem->encode( Content => $obj, Password => 'xx' );
141 + ok $blob, 'encode gave us something';
142 + $obj2 = $pem->decode( Content => $blob );
143 + ok !defined $obj2, 'decode fails on encrypted input';
144 +-like $pem->errstr, qr/^Decryption failed/, 'errstr matches decrypt failed';
145 + $obj2 = $pem->decode( Content => $blob, Password => 'xx' );
146 + is $obj->{TestObject}{int}, $obj2->{TestObject}{int}, 'input matches output';
147 +
148 +--
149 +2.14.1
150 +
151
152 diff --git a/dev-perl/Convert-PEM/files/Convert-PEM-0.80.0-testbuilder.patch b/dev-perl/Convert-PEM/files/Convert-PEM-0.80.0-testbuilder.patch
153 new file mode 100644
154 index 00000000000..f12b64d5c5f
155 --- /dev/null
156 +++ b/dev-perl/Convert-PEM/files/Convert-PEM-0.80.0-testbuilder.patch
157 @@ -0,0 +1,29 @@
158 +From 831b57ff2167e1192964c190271767e469dac48a Mon Sep 17 00:00:00 2001
159 +From: Kent Fredric <kentnl@g.o>
160 +Date: Tue, 3 Oct 2017 05:01:21 +1300
161 +Subject: Fix Test::Builder warning
162 +
163 +Ideally upstream should just stop bundling Test::Builder, but this
164 +is the smallest change that avoids the issue
165 +
166 +Bug: https://rt.cpan.org/Ticket/Display.html?id=111009
167 +---
168 + inc/Test/Builder.pm | 2 +-
169 + 1 file changed, 1 insertion(+), 1 deletion(-)
170 +
171 +diff --git a/inc/Test/Builder.pm b/inc/Test/Builder.pm
172 +index 795361f..6b0c8c3 100644
173 +--- a/inc/Test/Builder.pm
174 ++++ b/inc/Test/Builder.pm
175 +@@ -589,7 +589,7 @@ sub _is_dualvar {
176 +
177 + no warnings 'numeric';
178 + my $numval = $val + 0;
179 +- return $numval != 0 and $numval ne $val ? 1 : 0;
180 ++ return ($numval != 0 and $numval ne $val ? 1 : 0);
181 + }
182 +
183 + #line 876
184 +--
185 +2.14.1
186 +