Fix the tests of Compress-Raw-Zlib and IO-Compress to build with zlib 1.2.12

This commit is contained in:
Jitka Plesnikova 2022-08-22 15:34:25 +02:00
parent 024eae9d94
commit 4c35dd39c2
3 changed files with 279 additions and 1 deletions

View File

@ -0,0 +1,143 @@
From b864a746559843cd8bc1720eaf14c83faeb8fcc7 Mon Sep 17 00:00:00 2001
From: Paul Marquess <pmqs@cpan.org>
Date: Wed, 6 Apr 2022 12:17:05 +0000
Subject: [PATCH] Sync Compress-Raw-Zlib-2.103 + 2 others into blead
This commit synchs into blead versions 2.103 for 3 CPAN distributions:
Compress-Raw-Zlib
IO-Compress
Compress-Raw-Bzip2
Applying the commits one at a time would have resulted in one test
failure in one of those commits, but applying all three has all tests
passing as expected
From Changes for Compress-Raw-Zlib
2.103 3 April 2022
* Sync upstream fix for CVE-2018-25032
https://github.com/advisories/GHSA-jc36-42cf-vqwj
Update to Zlib 1.2.12
d507f527768f6cbab5831ed3ec17fe741163785c
Fix for inflateSync return code change
f47ea5f36c40fe19efe404dd75fd790b115de596
Fix for incorrect CRC from zlib 1.2.12.1
https://github.com/madler/zlib/commit/ec3df00224d4b396e2ac6586ab5d25f673caa4c2
60104e3a162a116548303861ae0811fb850e65fd
* AUTHOR doesn't contain the stated information
bf5a03c1b440c8d9e41cffb344bf889794cc532b
From Changes for IO-Compress
2.103 3 April 2022
* Update version to 2.103
97f1893892eccac69b3a8033378b0b44d7c4f3ab
* Fix for inflateSyncs retrurn code change
4843e22285bf8e52c9b5b913d167a1545995c793
* Add constant for ZIP_CM_AES
91be04dd8dc2848e3c25b87ec498cf8ccc34187a
* Point links to rfcs to ietf.org
https://github.com/pmqs/IO-Compress/pull/37
a8f28b36cf4d77df1cfa0516867012425920a62f
* Rename test file to fix manifest warning
https://github.com/pmqs/IO-Compress/pull/36
955244f9ac0654d7e8d54115162da53c85d7178c
* Add perl 5.34
06f41883f62ed1b88b03c246b16e0b5ef72503bc
* Fix for Calling nextStream on an IO::Uncompress::Zip object in Transparent mode dies when input is uncompressed
https://github.com/pmqs/IO-Compress/issues/34
b0f93fe62f84b7d4d4bb8d2ea8e6d5432887103f
* IO::Compress: Generalize for EBCDIC
https://github.com/pmqs/IO-Compress/pull/32
90b51dbbd785e2c824cb0a93feef3b3dd5d075f2
* IO::Compress: Fix misspelling in 112utf8-zip.t
c22216b5d3202dce01ef17a271252f82520a6ab9
* Revert "Always have full zip64 entry in central directory"
7df4c9bc98667bc1afd1b4bc5a27d20f94e3cd9c
* Always have full zip64 entry in central directory
333648ee1dece6eb220060c7ec09806f6ebb9866
* update cpanm path on MacOS
33079902934885c515768a08d72e89243a5d01a9
From Changes for Compress-Raw-Bzip2
2.103 3 April 2022
* Silence uninitialized warnings
https://github.com/pmqs/Compress-Raw-Bzip2/pull/5
ff3d907325091287ac1525db384b99a968d763d7
641a440ec6229c1d368b9ead48f4968b955c0115
---
cpan/Compress-Raw-Zlib/t/02zlib.t | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/cpan/Compress-Raw-Zlib/t/02zlib.t b/cpan/Compress-Raw-Zlib/t/02zlib.t
index 64c894465f..9b2e9cb6a0 100644
--- a/cpan/Compress-Raw-Zlib/t/02zlib.t
+++ b/cpan/Compress-Raw-Zlib/t/02zlib.t
@@ -13,6 +13,7 @@ use bytes;
use Test::More ;
use CompTestUtils;
+use constant ZLIB_1_2_12_0 => 0x12C0;
BEGIN
{
@@ -490,7 +491,16 @@ SKIP:
last if $status == Z_STREAM_END or $status != Z_OK ;
}
- cmp_ok $status, '==', Z_DATA_ERROR ;
+ # Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib
+ if (ZLIB_VERNUM >= ZLIB_1_2_12_0)
+ {
+ cmp_ok $status, '==', Z_STREAM_END ;
+ }
+ else
+ {
+ cmp_ok $status, '==', Z_DATA_ERROR ;
+ }
+
is $GOT, $goodbye ;
@@ -514,7 +524,17 @@ SKIP:
is length($rest), $len2, "expected compressed output";
$GOT = '';
- cmp_ok $k->inflate($rest, $GOT), '==', Z_DATA_ERROR, "inflate returns Z_DATA_ERROR";
+ $status = $k->inflate($rest, $GOT);
+ # Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib
+ if (ZLIB_VERNUM >= ZLIB_1_2_12_0)
+ {
+ cmp_ok $status, '==', Z_STREAM_END ;
+ }
+ else
+ {
+ cmp_ok $status, '==', Z_DATA_ERROR ;
+ }
+
is $GOT, $goodbye ;
}
--
2.37.2

View File

@ -0,0 +1,125 @@
From b864a746559843cd8bc1720eaf14c83faeb8fcc7 Mon Sep 17 00:00:00 2001
From: Paul Marquess <pmqs@cpan.org>
Date: Wed, 6 Apr 2022 12:17:05 +0000
Subject: [PATCH] Sync Compress-Raw-Zlib-2.103 + 2 others into blead
This commit synchs into blead versions 2.103 for 3 CPAN distributions:
Compress-Raw-Zlib
IO-Compress
Compress-Raw-Bzip2
Applying the commits one at a time would have resulted in one test
failure in one of those commits, but applying all three has all tests
passing as expected
From Changes for Compress-Raw-Zlib
2.103 3 April 2022
* Sync upstream fix for CVE-2018-25032
https://github.com/advisories/GHSA-jc36-42cf-vqwj
Update to Zlib 1.2.12
d507f527768f6cbab5831ed3ec17fe741163785c
Fix for inflateSync return code change
f47ea5f36c40fe19efe404dd75fd790b115de596
Fix for incorrect CRC from zlib 1.2.12.1
https://github.com/madler/zlib/commit/ec3df00224d4b396e2ac6586ab5d25f673caa4c2
60104e3a162a116548303861ae0811fb850e65fd
* AUTHOR doesn't contain the stated information
bf5a03c1b440c8d9e41cffb344bf889794cc532b
From Changes for IO-Compress
2.103 3 April 2022
* Update version to 2.103
97f1893892eccac69b3a8033378b0b44d7c4f3ab
* Fix for inflateSyncs retrurn code change
4843e22285bf8e52c9b5b913d167a1545995c793
* Add constant for ZIP_CM_AES
91be04dd8dc2848e3c25b87ec498cf8ccc34187a
* Point links to rfcs to ietf.org
https://github.com/pmqs/IO-Compress/pull/37
a8f28b36cf4d77df1cfa0516867012425920a62f
* Rename test file to fix manifest warning
https://github.com/pmqs/IO-Compress/pull/36
955244f9ac0654d7e8d54115162da53c85d7178c
* Add perl 5.34
06f41883f62ed1b88b03c246b16e0b5ef72503bc
* Fix for Calling nextStream on an IO::Uncompress::Zip object in Transparent mode dies when input is uncompressed
https://github.com/pmqs/IO-Compress/issues/34
b0f93fe62f84b7d4d4bb8d2ea8e6d5432887103f
* IO::Compress: Generalize for EBCDIC
https://github.com/pmqs/IO-Compress/pull/32
90b51dbbd785e2c824cb0a93feef3b3dd5d075f2
* IO::Compress: Fix misspelling in 112utf8-zip.t
c22216b5d3202dce01ef17a271252f82520a6ab9
* Revert "Always have full zip64 entry in central directory"
7df4c9bc98667bc1afd1b4bc5a27d20f94e3cd9c
* Always have full zip64 entry in central directory
333648ee1dece6eb220060c7ec09806f6ebb9866
* update cpanm path on MacOS
33079902934885c515768a08d72e89243a5d01a9
From Changes for Compress-Raw-Bzip2
2.103 3 April 2022
* Silence uninitialized warnings
https://github.com/pmqs/Compress-Raw-Bzip2/pull/5
ff3d907325091287ac1525db384b99a968d763d7
641a440ec6229c1d368b9ead48f4968b955c0115
---
cpan/IO-Compress/t/cz-03zlib-v1.t | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/cpan/IO-Compress/t/cz-03zlib-v1.t b/cpan/IO-Compress/t/cz-03zlib-v1.t
index 9b75f9b239..41734d055b 100644
--- a/cpan/IO-Compress/t/cz-03zlib-v1.t
+++ b/cpan/IO-Compress/t/cz-03zlib-v1.t
@@ -14,6 +14,8 @@ use Test::More ;
use CompTestUtils;
use Symbol;
+use constant ZLIB_1_2_12_0 => 0x12C0;
+
BEGIN
{
# use Test::NoWarnings, if available
@@ -700,7 +702,16 @@ EOM
($GOT, $status) = $k->inflate($rest) ;
- ok $status == Z_DATA_ERROR ;
+ # Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib
+ if (ZLIB_VERNUM >= ZLIB_1_2_12_0)
+ {
+ cmp_ok $status, '==', Z_STREAM_END ;
+ }
+ else
+ {
+ cmp_ok $status, '==', Z_DATA_ERROR ;
+ }
+
ok $Z . $GOT eq $goodbye ;
}
--
2.37.2

View File

@ -104,7 +104,7 @@ License: GPL+ or Artistic
Epoch: %{perl_epoch}
Version: %{perl_version}
# release number must be even higher, because dual-lived modules will be broken otherwise
Release: 486%{?dist}
Release: 487%{?dist}
Summary: Practical Extraction and Report Language
Url: https://www.perl.org/
Source0: https://www.cpan.org/src/5.0/perl-%{perl_version}.tar.xz
@ -168,6 +168,10 @@ Patch12: perl-5.27.8-hints-linux-Add-lphtread-to-lddlflags.patch
# Pass the correct CFLAGS to dtrace
Patch13: perl-5.28.0-Pass-CFLAGS-to-dtrace.patch
# Fix the tests to build with zlib 1.2.12 - is part of Fedora 37 and higher
Patch14: perl-5.34.1-Fix-Compress-Raw-Zlib-test-for-zlib-1.2.12.patch
Patch15: perl-5.34.1-Fix-IO-Compress-test-for-zlib-1.2.12.patch
# Link XS modules to libperl.so with EU::CBuilder on Linux, bug #960048
Patch200: perl-5.16.3-Link-XS-modules-to-libperl.so-with-EU-CBuilder-on-Li.patch
@ -4193,6 +4197,8 @@ you're not running VMS, this module does nothing.
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch200 -p1
%patch201 -p1
@ -6991,6 +6997,10 @@ popd
# Old changelog entries are preserved in CVS.
%changelog
* Mon Aug 22 2022 Jitka Plesnikova <jplesnik@redhat.com> - 4:5.34.1-487
- Fix the tests of Compress-Raw-Zlib and IO-Compress to build with
zlib 1.2.12
* Tue Mar 15 2022 Michal Josef Špaček <mspacek@redhat.com> - 4:5.34.1-486
- Fix minimal version for Perl debugger
- 5.34.1 bump