From 4295e6756d8fec5ccf53a865b11371326d35e92c Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Wed, 25 Jan 2023 19:20:44 +0800 Subject: [PATCH] Fix test with newer zlib --- ...mpress-Raw-Zlib-test-for-zlib-1.2.12.patch | 143 ++++++++++++++++++ ...Fix-IO-Compress-test-for-zlib-1.2.12.patch | 125 +++++++++++++++ perl.spec | 11 +- 3 files changed, 278 insertions(+), 1 deletion(-) create mode 100644 perl-5.34.1-Fix-Compress-Raw-Zlib-test-for-zlib-1.2.12.patch create mode 100644 perl-5.34.1-Fix-IO-Compress-test-for-zlib-1.2.12.patch diff --git a/perl-5.34.1-Fix-Compress-Raw-Zlib-test-for-zlib-1.2.12.patch b/perl-5.34.1-Fix-Compress-Raw-Zlib-test-for-zlib-1.2.12.patch new file mode 100644 index 0000000..fc77b6a --- /dev/null +++ b/perl-5.34.1-Fix-Compress-Raw-Zlib-test-for-zlib-1.2.12.patch @@ -0,0 +1,143 @@ +From b864a746559843cd8bc1720eaf14c83faeb8fcc7 Mon Sep 17 00:00:00 2001 +From: Paul Marquess +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 + diff --git a/perl-5.34.1-Fix-IO-Compress-test-for-zlib-1.2.12.patch b/perl-5.34.1-Fix-IO-Compress-test-for-zlib-1.2.12.patch new file mode 100644 index 0000000..aa32ef1 --- /dev/null +++ b/perl-5.34.1-Fix-IO-Compress-test-for-zlib-1.2.12.patch @@ -0,0 +1,125 @@ +From b864a746559843cd8bc1720eaf14c83faeb8fcc7 Mon Sep 17 00:00:00 2001 +From: Paul Marquess +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 + diff --git a/perl.spec b/perl.spec index 6112d66..bca622e 100644 --- a/perl.spec +++ b/perl.spec @@ -1,4 +1,4 @@ -%global anolis_release 6 +%global anolis_release 7 %global perl_version 5.34.0 %global perl_epoch 4 @@ -52,6 +52,10 @@ Patch4: perl-5.34.0-Fix-GDBM_File-to-compile-with-version-1.20-and-earli Patch5: perl-5.34.0-Raise-version-number-in-ext-GDBM_File-GDBM_File.pm.patch Patch6: perl-5.34.0-Fix-definition-of-ITEM_NOT_FOUND-for-pre-1.13-versio.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 + BuildRequires: bash BuildRequires: bzip2-devel BuildRequires: coreutils @@ -1798,6 +1802,8 @@ you're not running VMS, this module does nothing. %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch14 -p1 +%patch15 -p1 # recode() @@ -3464,6 +3470,9 @@ popd %{_mandir}/man3/vmsish.* %changelog +* Wed Jan 25 2023 Funda Wang - 5.34.0-7 +- Fix test with newer zlib + * Fri Apr 08 2022 Chunmei Xu - 5.34.0-6 - remove libdb and DB_File -- Gitee