From b5cb7677f2aa326642491dcc93753b693fc968ad Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 19 Jan 2025 09:44:15 +0000 Subject: [PATCH 01/28] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From a69e2b2a47044209397c6c2c19277c10b2d07255 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 29 Apr 2024 15:40:46 -0400 Subject: [PATCH 02/28] Update to 2.1.0 --- .gitignore | 4 + get_test_data.sh | 69 +++++++++++++++ rust-zip.spec | 177 +++++++++++++++++++++++++++++++++++-- rust2rpm.toml | 46 ++++++++-- sources | 3 +- zip-fix-metadata-auto.diff | 9 ++ zip-fix-metadata.diff | 33 ------- 7 files changed, 290 insertions(+), 51 deletions(-) create mode 100755 get_test_data.sh create mode 100644 zip-fix-metadata-auto.diff delete mode 100644 zip-fix-metadata.diff diff --git a/.gitignore b/.gitignore index be3d35a..f801cca 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,7 @@ /zip-0.5.13.crate /zip-0.6.4.crate /zip-0.6.6.crate +/zip-1.1.4.crate +/zip2-1.1.4.tar.gz +/zip-2.1.0.crate +/zip2-2.1.0-filtered.tar.gz diff --git a/get_test_data.sh b/get_test_data.sh new file mode 100755 index 0000000..798f35e --- /dev/null +++ b/get_test_data.sh @@ -0,0 +1,69 @@ +#!/bin/sh +set -o nounset +set -o errexit + +FORGEURL='https://github.com/zip-rs/zip2' + +print_help() +{ + cat <&2 + print_help "${0}" + exit 1 +elif [ "${1-}" = '-h' ] || [ "${1-}" = '--help' ] +then + print_help "${0}" + exit 0 +fi + +VERSION="${1}" +SOURCE0="${FORGEURL}/archive/v${VERSION}/zip2-${VERSION}.tar.gz" +TARNAME="$(basename "${SOURCE0}")" +TARDIR="$(basename "${SOURCE0}" '.tar.gz')" +NEWTAR="${TARDIR}-filtered.tar.gz" + +SAVEDIR="${PWD}" +XDIR="$(mktemp -d)" +trap "rm -rvf '${XDIR}'" INT TERM EXIT + +cd "${XDIR}" +curl -L -O "${SOURCE0}" +tar -xzf "${TARNAME}" +MTIME="$(stat -c '%Y' "${TARDIR}")" +# Remove everything but tests/data +find "${TARDIR}" -mindepth 1 -maxdepth 1 ! -name tests -execdir rm -rv '{}' '+' +find "${TARDIR}/tests" -mindepth 1 -maxdepth 1 ! -name data \ + -execdir rm -rv '{}' '+' +# LICENSE.lin-ub_iwd-v11.zip.txt clearly shows that lin-ub_iwd-v11.zip is at +# *best* not under a license acceptable in Fedora. +rm "${TARDIR}/tests/data/LICENSE.lin-ub_iwd-v11.zip.txt" \ + "${TARDIR}/tests/data/lin-ub_iwd-v11.zip" +# https://www.gnu.org/software/tar/manual/html_section/Reproducibility.html +# We reset all mtimes to that of the top-level extracted directory; since git +# archives don’t have meaningful per-file mtimes, nothing useful is lost. +TZ=UTC LC_ALL=C tar \ + --create --verbose \ + --sort=name \ + --format=posix \ + --numeric-owner --owner=0 --group=0 \ + --mode=go+u,go-w \ + --pax-option='delete=atime,delete=ctime' \ + --clamp-mtime --mtime="@${MTIME}" \ + "${TARDIR}/" | + gzip -9 > "${NEWTAR}" +touch -d @"${MTIME}" "${NEWTAR}" + +cd "${SAVEDIR}" +mv -v "${XDIR}/${NEWTAR}" . diff --git a/rust-zip.spec b/rust-zip.spec index fd33e21..b0b3693 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -1,25 +1,30 @@ -# Generated by rust2rpm 26 -%bcond_without check +# Generated by rust2rpm 27 +%bcond check 1 %global debug_package %{nil} %global crate zip Name: rust-zip -Version: 0.6.6 +Version: 2.1.0 Release: %autorelease Summary: Library to support the reading and writing of zip files License: MIT URL: https://crates.io/crates/zip Source: %{crates_source} -# Manually created patch for downstream crate metadata changes -# * bump constant_time_eq dependency from 0.1 to 0.3 -# * bump pbkdf2 dependency from 0.11 to 0.12 -# * bump zstd dependency from 0.11 to 0.13 -# * drop unused, benchmark-only bencher dev-dependency -Patch: zip-fix-metadata.diff +# * A copy of the GitHub source archive for zip-rs/zip2, with everything but the +# test/data/ subdirectory removed, and additionally, from which test files +# with known license issues have been removed. Fortunately, no removed test +# files are required for any of the tests that are present in the published +# crates. +Source10: zip2-%{version}-filtered.tar.gz +# * Script used to generate Source11: ./get_test_data.sh %%{version} +Source11: get_test_data.sh +# Automatically generated patch to strip dependencies and normalize metadata +Patch: zip-fix-metadata-auto.diff BuildRequires: cargo-rpm-macros >= 24 +BuildRequires: tomcli %global _description %{expand: Library to support the reading and writing of zip files.} @@ -39,7 +44,9 @@ use the "%{crate}" crate. %license %{crate_instdir}/LICENSE %doc %{crate_instdir}/CHANGELOG.md %doc %{crate_instdir}/CODE_OF_CONDUCT.md +%doc %{crate_instdir}/CONTRIBUTING.md %doc %{crate_instdir}/README.md +%doc %{crate_instdir}/pull_request_template.md %{crate_instdir}/ %package -n %{name}+default-devel @@ -54,6 +61,30 @@ use the "default" feature of the "%{crate}" crate. %files -n %{name}+default-devel %ghost %{crate_instdir}/Cargo.toml +%package -n %{name}+_all-features-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+_all-features-devel %{_description} + +This package contains library source intended for building other packages which +use the "_all-features" feature of the "%{crate}" crate. + +%files -n %{name}+_all-features-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+_deflate-any-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+_deflate-any-devel %{_description} + +This package contains library source intended for building other packages which +use the "_deflate-any" feature of the "%{crate}" crate. + +%files -n %{name}+_deflate-any-devel +%ghost %{crate_instdir}/Cargo.toml + %package -n %{name}+aes-devel Summary: %{summary} BuildArch: noarch @@ -90,6 +121,18 @@ use the "bzip2" feature of the "%{crate}" crate. %files -n %{name}+bzip2-devel %ghost %{crate_instdir}/Cargo.toml +%package -n %{name}+chrono-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+chrono-devel %{_description} + +This package contains library source intended for building other packages which +use the "chrono" feature of the "%{crate}" crate. + +%files -n %{name}+chrono-devel +%ghost %{crate_instdir}/Cargo.toml + %package -n %{name}+constant_time_eq-devel Summary: %{summary} BuildArch: noarch @@ -114,6 +157,18 @@ use the "deflate" feature of the "%{crate}" crate. %files -n %{name}+deflate-devel %ghost %{crate_instdir}/Cargo.toml +%package -n %{name}+deflate-flate2-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+deflate-flate2-devel %{_description} + +This package contains library source intended for building other packages which +use the "deflate-flate2" feature of the "%{crate}" crate. + +%files -n %{name}+deflate-flate2-devel +%ghost %{crate_instdir}/Cargo.toml + %package -n %{name}+deflate-miniz-devel Summary: %{summary} BuildArch: noarch @@ -138,6 +193,42 @@ use the "deflate-zlib" feature of the "%{crate}" crate. %files -n %{name}+deflate-zlib-devel %ghost %{crate_instdir}/Cargo.toml +%package -n %{name}+deflate-zlib-ng-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+deflate-zlib-ng-devel %{_description} + +This package contains library source intended for building other packages which +use the "deflate-zlib-ng" feature of the "%{crate}" crate. + +%files -n %{name}+deflate-zlib-ng-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+deflate-zopfli-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+deflate-zopfli-devel %{_description} + +This package contains library source intended for building other packages which +use the "deflate-zopfli" feature of the "%{crate}" crate. + +%files -n %{name}+deflate-zopfli-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+deflate64-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+deflate64-devel %{_description} + +This package contains library source intended for building other packages which +use the "deflate64" feature of the "%{crate}" crate. + +%files -n %{name}+deflate64-devel +%ghost %{crate_instdir}/Cargo.toml + %package -n %{name}+flate2-devel Summary: %{summary} BuildArch: noarch @@ -162,6 +253,30 @@ use the "hmac" feature of the "%{crate}" crate. %files -n %{name}+hmac-devel %ghost %{crate_instdir}/Cargo.toml +%package -n %{name}+lzma-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+lzma-devel %{_description} + +This package contains library source intended for building other packages which +use the "lzma" feature of the "%{crate}" crate. + +%files -n %{name}+lzma-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+lzma-rs-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+lzma-rs-devel %{_description} + +This package contains library source intended for building other packages which +use the "lzma-rs" feature of the "%{crate}" crate. + +%files -n %{name}+lzma-rs-devel +%ghost %{crate_instdir}/Cargo.toml + %package -n %{name}+pbkdf2-devel Summary: %{summary} BuildArch: noarch @@ -174,6 +289,18 @@ use the "pbkdf2" feature of the "%{crate}" crate. %files -n %{name}+pbkdf2-devel %ghost %{crate_instdir}/Cargo.toml +%package -n %{name}+rand-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+rand-devel %{_description} + +This package contains library source intended for building other packages which +use the "rand" feature of the "%{crate}" crate. + +%files -n %{name}+rand-devel +%ghost %{crate_instdir}/Cargo.toml + %package -n %{name}+sha1-devel Summary: %{summary} BuildArch: noarch @@ -210,6 +337,30 @@ use the "unreserved" feature of the "%{crate}" crate. %files -n %{name}+unreserved-devel %ghost %{crate_instdir}/Cargo.toml +%package -n %{name}+zeroize-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+zeroize-devel %{_description} + +This package contains library source intended for building other packages which +use the "zeroize" feature of the "%{crate}" crate. + +%files -n %{name}+zeroize-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+zopfli-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+zopfli-devel %{_description} + +This package contains library source intended for building other packages which +use the "zopfli" feature of the "%{crate}" crate. + +%files -n %{name}+zopfli-devel +%ghost %{crate_instdir}/Cargo.toml + %package -n %{name}+zstd-devel Summary: %{summary} BuildArch: noarch @@ -225,6 +376,11 @@ use the "zstd" feature of the "%{crate}" crate. %prep %autosetup -n %{crate}-%{version} -p1 %cargo_prep +# Remove some benchmark-only and/or example-only dependencies +for dep in anyhow bencher clap getrandom walkdir +do + tomcli set Cargo.toml del "dev-dependencies.${dep}" +done %generate_buildrequires %cargo_generate_buildrequires -a @@ -237,6 +393,9 @@ use the "zstd" feature of the "%{crate}" crate. %if %{with check} %check +# Extract test data (only) from the GitHub archive +tar -xzvf '%{SOURCE10}' --strip-components=1 'zip2-%{version}/tests/data/' +cp -vp '%{SOURCE11}' tests/data/ %cargo_test -a %endif diff --git a/rust2rpm.toml b/rust2rpm.toml index f5e36c2..d650737 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -1,11 +1,41 @@ -[package] -cargo-toml-patch-comments = [ - "bump constant_time_eq dependency from 0.1 to 0.3", - "bump pbkdf2 dependency from 0.11 to 0.12", - "bump zstd dependency from 0.11 to 0.13", - "drop unused, benchmark-only bencher dev-dependency", -] - [features] enable-all = true +[requires] +build = [ + "tomcli", +] + +[package] +[[package.extra-sources]] +number = 10 +file = "zip2-%{version}-filtered.tar.gz" +comments = [ + """\ + A copy of the GitHub source archive for zip-rs/zip2, with everything but the \ + test/data/ subdirectory removed, and additionally, from which test files with \ + known license issues have been removed. Fortunately, no removed test files \ + are required for any of the tests that are present in the published crates.\ + """, +] +[[package.extra-sources]] +number = 11 +file = "get_test_data.sh" +comments = [ + "Script used to generate Source11: ./get_test_data.sh %%{version}" +] + +[scripts.prep] +post = [ + "# Remove some benchmark-only and/or example-only dependencies", + "for dep in anyhow bencher clap getrandom walkdir", + "do", + " tomcli set Cargo.toml del \"dev-dependencies.${dep}\"", + "done", +] +[scripts.check] +pre = [ + "# Extract test data (only) from the GitHub archive", + "tar -xzvf '%{SOURCE10}' --strip-components=1 'zip2-%{version}/tests/data/'", + "cp -vp '%{SOURCE11}' tests/data/", +] diff --git a/sources b/sources index b0f021f..e4f457b 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -SHA512 (zip-0.6.6.crate) = affd46c17ceaa0545a155250dfd16756f8706dda43bae8a322ec0481dbfb41e4cf3166bf9662fc139ef9d0ab3b0f9f158535b21d2a61b21d38b8b2407813eeef +SHA512 (zip-2.1.0.crate) = 14e5ddaf352f9d73c93322af4af5f9af1c8ed080b239b4cfd3d2fed8d26846a75068d2cdc589672147ea48076cd83161dad262f53b87e3797bf2ef85748e5668 +SHA512 (zip2-2.1.0-filtered.tar.gz) = b25b94a7c1c9575ff0aab8b133c6e8149a1b3e2b2b4c0f37c5f64c9cb9bec385d39dc9de6c33f73f2e0e7abbf549505189ebdc08dd1b0bd5e6e6024ed9a1883a diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff new file mode 100644 index 0000000..12584e4 --- /dev/null +++ b/zip-fix-metadata-auto.diff @@ -0,0 +1,9 @@ +--- zip-2.1.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-2.1.0/Cargo.toml 2025-03-13T15:43:38.858758+00:00 +@@ -236,6 +236,3 @@ + [target."cfg(any(all(target_arch = \"arm\", target_pointer_width = \"32\"), target_arch = \"mips\", target_arch = \"powerpc\"))".dependencies.crossbeam-utils] + version = "0.8.19" + +-[target."cfg(fuzzing)".dependencies.arbitrary] +-version = "1.3.2" +-features = ["derive"] diff --git a/zip-fix-metadata.diff b/zip-fix-metadata.diff deleted file mode 100644 index 7992426..0000000 --- a/zip-fix-metadata.diff +++ /dev/null @@ -1,33 +0,0 @@ ---- zip-0.6.6/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-0.6.6/Cargo.toml 2024-09-19T17:54:06.895145+00:00 -@@ -50,7 +50,7 @@ - optional = true - - [dependencies.constant_time_eq] --version = "0.1.5" -+version = "0.3" - optional = true - - [dependencies.crc32fast] -@@ -67,7 +67,7 @@ - optional = true - - [dependencies.pbkdf2] --version = "0.11.0" -+version = "0.12.0" - optional = true - - [dependencies.sha1] -@@ -81,11 +81,8 @@ - default-features = false - - [dependencies.zstd] --version = "0.11.2" -+version = "0.13" - optional = true -- --[dev-dependencies.bencher] --version = "0.1.5" - - [dev-dependencies.getrandom] - version = "0.2.5" From ec69f68e2444493b23b9c6a0a7417addcc4bb8e8 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 13 Mar 2025 14:26:36 -0400 Subject: [PATCH 03/28] Maintain a list of *allowed* test data files --- get_test_data.sh | 77 +++++++++++++++++++++++++++++++++++++++++------- sources | 2 +- 2 files changed, 67 insertions(+), 12 deletions(-) diff --git a/get_test_data.sh b/get_test_data.sh index 798f35e..8717609 100755 --- a/get_test_data.sh +++ b/get_test_data.sh @@ -4,16 +4,67 @@ set -o errexit FORGEURL='https://github.com/zip-rs/zip2' +# These are test data files that have been audited for obvious issues. What +# kind of issues might there be? +# +# - Acceptable license, but no license text +# - No known license / presumed or explicitly proprietary +# - Mysterious precompiled binaries +# +# Files we have determined we should *not* include: +# +# - chinese.zip: +# The single text file it contains, 七个房间.txt, contains a significant +# amount of narrative text in GB2312 encoding: some kind of story, or an +# excerpt from one, perhaps a work of fiction. It’s not clear what the origin +# is or what license, if any, might apply. +# - lin-ub_iwd-v11.zip: +# LICENSE.lin-ub_iwd-v11.zip.txt clearly shows that this is at *best* not +# under a license acceptable in Fedora. +# - pandoc_soft_links.zip: +# Contains a copy of pandoc 3.2 compiled for aarch64: pandoc itself is +# open-source, but who can say what was linked into it? The complete list of +# applicable licenses is not knowable. +OK_FILES="$(grep -vE '^(#|$)' < Date: Thu, 13 Mar 2025 14:38:22 -0400 Subject: [PATCH 04/28] Update to 2.1.3 --- .gitignore | 2 ++ get_test_data.sh | 4 ++-- rust-zip.spec | 2 +- sources | 4 ++-- zip-fix-metadata-auto.diff | 6 +++--- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index f801cca..461c6b2 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ /zip2-1.1.4.tar.gz /zip-2.1.0.crate /zip2-2.1.0-filtered.tar.gz +/zip-2.1.3.crate +/zip2-2.1.3-filtered.tar.gz diff --git a/get_test_data.sh b/get_test_data.sh index 8717609..c3fabb1 100755 --- a/get_test_data.sh +++ b/get_test_data.sh @@ -30,11 +30,11 @@ OK_FILES="$(grep -vE '^(#|$)' < Date: Thu, 13 Mar 2025 14:47:16 -0400 Subject: [PATCH 05/28] Update to 2.1.4 --- .gitignore | 2 ++ rust-zip.spec | 17 ++++++++++++++++- rust2rpm.toml | 10 ++++++++++ sources | 4 ++-- zip-2.1.4-omitted-test-files.patch | 12 ++++++++++++ zip-fix-metadata-auto.diff | 8 ++++---- 6 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 zip-2.1.4-omitted-test-files.patch diff --git a/.gitignore b/.gitignore index 461c6b2..3d080ea 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ /zip2-2.1.0-filtered.tar.gz /zip-2.1.3.crate /zip2-2.1.3-filtered.tar.gz +/zip-2.1.4.crate +/zip2-2.1.4-filtered.tar.gz diff --git a/rust-zip.spec b/rust-zip.spec index 91d7d95..06959a3 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -5,7 +5,7 @@ %global crate zip Name: rust-zip -Version: 2.1.3 +Version: 2.1.4 Release: %autorelease Summary: Library to support the reading and writing of zip files @@ -22,6 +22,9 @@ Source10: zip2-%{version}-filtered.tar.gz Source11: get_test_data.sh # Automatically generated patch to strip dependencies and normalize metadata Patch: zip-fix-metadata-auto.diff +# * Downstream-only: patch out tests that would need omitted test files to +# compile +Patch10: zip-2.1.4-omitted-test-files.patch BuildRequires: cargo-rpm-macros >= 24 BuildRequires: tomcli @@ -337,6 +340,18 @@ use the "unreserved" feature of the "%{crate}" crate. %files -n %{name}+unreserved-devel %ghost %{crate_instdir}/Cargo.toml +%package -n %{name}+xz-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+xz-devel %{_description} + +This package contains library source intended for building other packages which +use the "xz" feature of the "%{crate}" crate. + +%files -n %{name}+xz-devel +%ghost %{crate_instdir}/Cargo.toml + %package -n %{name}+zeroize-devel Summary: %{summary} BuildArch: noarch diff --git a/rust2rpm.toml b/rust2rpm.toml index d650737..39e59a1 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -25,6 +25,16 @@ comments = [ "Script used to generate Source11: ./get_test_data.sh %%{version}" ] +[[package.extra-patches]] +number = 10 +file = "zip-2.1.4-omitted-test-files.patch" +comments = [ + """\ + Downstream-only: patch out tests that would need omitted test files to \ + compile\ + """, +] + [scripts.prep] post = [ "# Remove some benchmark-only and/or example-only dependencies", diff --git a/sources b/sources index 64ab2d0..2f810cb 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zip-2.1.3.crate) = 180fda1b4cff4f396616eccff5140c31e2fc1999e5a89a8590d5fb933a9bf075d68ab84d33a041402fcd30c579de164d716a44a49a12b869e05248f9f518072f -SHA512 (zip2-2.1.3-filtered.tar.gz) = 5c980040dbdaff8e7681bbf15ce54959b22f5c988ea03dd96f142fc5c9c9750b4781599942686a2cc64c3d7cca4df0ab7c7b99db93150f85573be97edc05d57a +SHA512 (zip-2.1.4.crate) = 8ac5b04631638c0144ce575dc77c46f8dfe2b387b25de75965ecc973216138c3e7f3092fc68544cf3b6d4d8b42bd1c09cb600867f5c23727882ae9b02b2a169f +SHA512 (zip2-2.1.4-filtered.tar.gz) = 3634dd806637cafa2e5e5d88b45a5b3629837c8edbaad085fc8dbef4e2c27679b9c67197698bc7307db3a2e92bf99a977dcc422746841039787bc38a46d8842d diff --git a/zip-2.1.4-omitted-test-files.patch b/zip-2.1.4-omitted-test-files.patch new file mode 100644 index 0000000..50da969 --- /dev/null +++ b/zip-2.1.4-omitted-test-files.patch @@ -0,0 +1,12 @@ +diff -Naur zip-2.1.4-original/src/read.rs zip-2.1.4/src/read.rs +--- zip-2.1.4-original/src/read.rs 2006-07-23 21:21:28.000000000 -0400 ++++ zip-2.1.4/src/read.rs 2025-03-13 14:43:54.173101323 -0400 +@@ -2170,6 +2170,8 @@ + + #[test] + #[cfg(feature = "_deflate-any")] ++ // Downstream patch: we do not include the test file needed for this test. ++ #[cfg(any())] + fn test_utf8_extra_field() { + let mut v = Vec::new(); + v.extend_from_slice(include_bytes!("../tests/data/chinese.zip")); diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index f5e9eae..d922fcb 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,7 +1,7 @@ ---- zip-2.1.3/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.1.3/Cargo.toml 2025-03-13T18:36:24.823746+00:00 -@@ -236,6 +236,3 @@ - [target."cfg(any(all(target_arch = \"arm\", target_pointer_width = \"32\"), target_arch = \"mips\", target_arch = \"powerpc\"))".dependencies.crossbeam-utils] +--- zip-2.1.4/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-2.1.4/Cargo.toml 2025-03-13T18:46:18.986556+00:00 +@@ -238,6 +238,3 @@ + [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] version = "0.8.20" -[target."cfg(fuzzing)".dependencies.arbitrary] From 919b00b38cde3afe9ac5813f5fa486f1c4897b75 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 13 Mar 2025 14:59:51 -0400 Subject: [PATCH 06/28] Update to 2.1.5 --- .gitignore | 2 ++ 591ce5d044ab43c4daaaa7d20bcaa9e45112b11f.patch | 14 ++++++++++++++ rust-zip.spec | 4 +++- rust2rpm.toml | 7 +++++++ sources | 4 ++-- zip-fix-metadata-auto.diff | 4 ++-- 6 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 591ce5d044ab43c4daaaa7d20bcaa9e45112b11f.patch diff --git a/.gitignore b/.gitignore index 3d080ea..32ff745 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ /zip2-2.1.3-filtered.tar.gz /zip-2.1.4.crate /zip2-2.1.4-filtered.tar.gz +/zip-2.1.5.crate +/zip2-2.1.5-filtered.tar.gz diff --git a/591ce5d044ab43c4daaaa7d20bcaa9e45112b11f.patch b/591ce5d044ab43c4daaaa7d20bcaa9e45112b11f.patch new file mode 100644 index 0000000..27eb6d8 --- /dev/null +++ b/591ce5d044ab43c4daaaa7d20bcaa9e45112b11f.patch @@ -0,0 +1,14 @@ +From 591ce5d044ab43c4daaaa7d20bcaa9e45112b11f Mon Sep 17 00:00:00 2001 +From: wiiznokes <78230769+wiiznokes@users.noreply.github.com> +Date: Tue, 19 Nov 2024 20:56:41 +0100 +Subject: [PATCH] fix: remove executable bit (#238) + +Co-authored-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> +--- + src/spec.rs | 0 + 1 file changed, 0 insertions(+), 0 deletions(-) + mode change 100755 => 100644 src/spec.rs + +diff --git a/src/spec.rs b/src/spec.rs +old mode 100755 +new mode 100644 diff --git a/rust-zip.spec b/rust-zip.spec index 06959a3..c81a9dc 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -5,7 +5,7 @@ %global crate zip Name: rust-zip -Version: 2.1.4 +Version: 2.1.5 Release: %autorelease Summary: Library to support the reading and writing of zip files @@ -25,6 +25,8 @@ Patch: zip-fix-metadata-auto.diff # * Downstream-only: patch out tests that would need omitted test files to # compile Patch10: zip-2.1.4-omitted-test-files.patch +# * fix: remove executable bit +Patch11: https://github.com/zip-rs/zip2/commit/591ce5d044ab43c4daaaa7d20bcaa9e45112b11f.patch BuildRequires: cargo-rpm-macros >= 24 BuildRequires: tomcli diff --git a/rust2rpm.toml b/rust2rpm.toml index 39e59a1..bb6db33 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -35,6 +35,13 @@ comments = [ """, ] +[[package.extra-patches]] +number = 11 +file = "https://github.com/zip-rs/zip2/commit/591ce5d044ab43c4daaaa7d20bcaa9e45112b11f.patch" +comments = [ + "fix: remove executable bit", +] + [scripts.prep] post = [ "# Remove some benchmark-only and/or example-only dependencies", diff --git a/sources b/sources index 2f810cb..e981493 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zip-2.1.4.crate) = 8ac5b04631638c0144ce575dc77c46f8dfe2b387b25de75965ecc973216138c3e7f3092fc68544cf3b6d4d8b42bd1c09cb600867f5c23727882ae9b02b2a169f -SHA512 (zip2-2.1.4-filtered.tar.gz) = 3634dd806637cafa2e5e5d88b45a5b3629837c8edbaad085fc8dbef4e2c27679b9c67197698bc7307db3a2e92bf99a977dcc422746841039787bc38a46d8842d +SHA512 (zip-2.1.5.crate) = f7c0b73515d5c44cfcd2b8e2184181bc89d85b339fad9424e74a4d450803b4325953fc97ed7a8f34babf805f18869cd23116fbb69055882dabe930c80a3b0b4f +SHA512 (zip2-2.1.5-filtered.tar.gz) = 02ae881f8d6581fc3113891fd89e8183ae72154a1c2b7cdbcc830ee965b66ff26e57e32df659d08d75c31639aedb8c64c1311ca9328599d51c3cfa17ec45481b diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index d922fcb..44481fe 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,5 +1,5 @@ ---- zip-2.1.4/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.1.4/Cargo.toml 2025-03-13T18:46:18.986556+00:00 +--- zip-2.1.5/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-2.1.5/Cargo.toml 2025-03-13T18:55:41.279830+00:00 @@ -238,6 +238,3 @@ [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] version = "0.8.20" From 599b420e7d3398884ec3bfc08e802eac01af33f7 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 13 Mar 2025 15:01:26 -0400 Subject: [PATCH 07/28] =?UTF-8?q?Remove=20=E2=80=9Ccurly=20quotes=E2=80=9D?= =?UTF-8?q?=20in=20get=5Ftest=5Fdata.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is nothing actually wrong with these (they are in quoted strings, and specifically in a part that is treated as a comment), but they make shellcheck nervous. [skip changelog] --- get_test_data.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/get_test_data.sh b/get_test_data.sh index c3fabb1..c853d63 100755 --- a/get_test_data.sh +++ b/get_test_data.sh @@ -41,7 +41,7 @@ zip64_magic_in_filename_2.zip zip64_magic_in_filename_4.zip zip64_magic_in_filename_5.zip -# These don’t unzip with the “unzip” tool, so they are difficult to audit, but +# These don’t unzip with the "unzip" tool, so they are difficult to audit, but # their sizes are only from a few dozen to a few hundred bytes, so we assume # their contents are very likely to be unproblematic. deflate64_issue_25.zip From e96938c7276ede05d6ec8f62902b2c86741e664d Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 13 Mar 2025 15:18:17 -0400 Subject: [PATCH 08/28] Update to 2.2.2 --- .gitignore | 2 ++ rust-zip.spec | 2 +- sources | 4 ++-- zip-fix-metadata-auto.diff | 6 +++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 32ff745..6e00d39 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ /zip2-2.1.4-filtered.tar.gz /zip-2.1.5.crate /zip2-2.1.5-filtered.tar.gz +/zip-2.2.2.crate +/zip2-2.2.2-filtered.tar.gz diff --git a/rust-zip.spec b/rust-zip.spec index c81a9dc..d65c3b4 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -5,7 +5,7 @@ %global crate zip Name: rust-zip -Version: 2.1.5 +Version: 2.2.2 Release: %autorelease Summary: Library to support the reading and writing of zip files diff --git a/sources b/sources index e981493..101df50 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zip-2.1.5.crate) = f7c0b73515d5c44cfcd2b8e2184181bc89d85b339fad9424e74a4d450803b4325953fc97ed7a8f34babf805f18869cd23116fbb69055882dabe930c80a3b0b4f -SHA512 (zip2-2.1.5-filtered.tar.gz) = 02ae881f8d6581fc3113891fd89e8183ae72154a1c2b7cdbcc830ee965b66ff26e57e32df659d08d75c31639aedb8c64c1311ca9328599d51c3cfa17ec45481b +SHA512 (zip-2.2.2.crate) = 0255079792b786a55dd18587daf178456f2b79f83d767ba42504f8b7163eebc152c02500097edd78bb37916444c9ad9905779367c6d743489502468258f1706e +SHA512 (zip2-2.2.2-filtered.tar.gz) = 1404b4e33ec1613c5fc12137ba6af445647c9437d19181368516a37cbbf6e3255db032a316f9e820e8101c938413254fc852418659b4abfb469294c1583c5e9d diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index 44481fe..24dd52e 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,6 +1,6 @@ ---- zip-2.1.5/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.1.5/Cargo.toml 2025-03-13T18:55:41.279830+00:00 -@@ -238,6 +238,3 @@ +--- zip-2.2.2/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-2.2.2/Cargo.toml 2025-03-13T19:17:45.445309+00:00 +@@ -237,6 +237,3 @@ [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] version = "0.8.20" From 43c5a89db641baf5aa0a7f664a6fa4fcbfea5b4e Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 13 Mar 2025 15:24:57 -0400 Subject: [PATCH 09/28] Update to 2.2.3 (close RHBZ#2276230) --- .gitignore | 2 ++ rust-zip.spec | 5 ++++- rust2rpm.toml | 4 ++++ sources | 4 ++-- zip-fix-metadata-auto.diff | 4 ++-- zip-fix-metadata.diff | 11 +++++++++++ 6 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 zip-fix-metadata.diff diff --git a/.gitignore b/.gitignore index 6e00d39..4b0f75c 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ /zip2-2.1.5-filtered.tar.gz /zip-2.2.2.crate /zip2-2.2.2-filtered.tar.gz +/zip-2.2.3.crate +/zip2-2.2.3-filtered.tar.gz diff --git a/rust-zip.spec b/rust-zip.spec index d65c3b4..896d1b3 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -5,7 +5,7 @@ %global crate zip Name: rust-zip -Version: 2.2.2 +Version: 2.2.3 Release: %autorelease Summary: Library to support the reading and writing of zip files @@ -22,6 +22,9 @@ Source10: zip2-%{version}-filtered.tar.gz Source11: get_test_data.sh # Automatically generated patch to strip dependencies and normalize metadata Patch: zip-fix-metadata-auto.diff +# Manually created patch for downstream crate metadata changes +# * For now, allow bzip2 0.4 (wants 0.5) +Patch: zip-fix-metadata.diff # * Downstream-only: patch out tests that would need omitted test files to # compile Patch10: zip-2.1.4-omitted-test-files.patch diff --git a/rust2rpm.toml b/rust2rpm.toml index bb6db33..49b832c 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -7,6 +7,10 @@ build = [ ] [package] +cargo-toml-patch-comments = [ + "For now, allow bzip2 0.4 (wants 0.5)", +] + [[package.extra-sources]] number = 10 file = "zip2-%{version}-filtered.tar.gz" diff --git a/sources b/sources index 101df50..7612542 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zip-2.2.2.crate) = 0255079792b786a55dd18587daf178456f2b79f83d767ba42504f8b7163eebc152c02500097edd78bb37916444c9ad9905779367c6d743489502468258f1706e -SHA512 (zip2-2.2.2-filtered.tar.gz) = 1404b4e33ec1613c5fc12137ba6af445647c9437d19181368516a37cbbf6e3255db032a316f9e820e8101c938413254fc852418659b4abfb469294c1583c5e9d +SHA512 (zip-2.2.3.crate) = 4c877d00fa49b896ff45b545bfe13d5d39163195a101a67e7a565ce3642b4d6d45bb01262f12c65b47d98a848e5248e7aa1c6556c6a01a7137643526292e2739 +SHA512 (zip2-2.2.3-filtered.tar.gz) = c90000416466c29ac7d87cccb2f44b466247bee1686b029697640547700e58259a99e3fda6dc999b2e04cf28728454172ff702511d258fad4075e88fb001b5d8 diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index 24dd52e..8fc6b96 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,5 +1,5 @@ ---- zip-2.2.2/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.2.2/Cargo.toml 2025-03-13T19:17:45.445309+00:00 +--- zip-2.2.3/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-2.2.3/Cargo.toml 2025-03-13T19:23:23.969319+00:00 @@ -237,6 +237,3 @@ [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] version = "0.8.20" diff --git a/zip-fix-metadata.diff b/zip-fix-metadata.diff new file mode 100644 index 0000000..0ba595d --- /dev/null +++ b/zip-fix-metadata.diff @@ -0,0 +1,11 @@ +--- zip-2.2.3/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-2.2.3/Cargo.toml 2025-03-13T19:23:44.624340+00:00 +@@ -125,7 +125,7 @@ + optional = true + + [dependencies.bzip2] +-version = "0.5.0" ++version = ">=0.4.4, <0.6.0" + optional = true + + [dependencies.chrono] From 73f5e29d1740eef0342ba256441cc7f5cdaf690c Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 13 Mar 2025 15:36:06 -0400 Subject: [PATCH 10/28] Drop a patch that is no longer needed --- 591ce5d044ab43c4daaaa7d20bcaa9e45112b11f.patch | 14 -------------- rust-zip.spec | 2 -- rust2rpm.toml | 7 ------- zip-fix-metadata-auto.diff | 2 +- zip-fix-metadata.diff | 2 +- 5 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 591ce5d044ab43c4daaaa7d20bcaa9e45112b11f.patch diff --git a/591ce5d044ab43c4daaaa7d20bcaa9e45112b11f.patch b/591ce5d044ab43c4daaaa7d20bcaa9e45112b11f.patch deleted file mode 100644 index 27eb6d8..0000000 --- a/591ce5d044ab43c4daaaa7d20bcaa9e45112b11f.patch +++ /dev/null @@ -1,14 +0,0 @@ -From 591ce5d044ab43c4daaaa7d20bcaa9e45112b11f Mon Sep 17 00:00:00 2001 -From: wiiznokes <78230769+wiiznokes@users.noreply.github.com> -Date: Tue, 19 Nov 2024 20:56:41 +0100 -Subject: [PATCH] fix: remove executable bit (#238) - -Co-authored-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> ---- - src/spec.rs | 0 - 1 file changed, 0 insertions(+), 0 deletions(-) - mode change 100755 => 100644 src/spec.rs - -diff --git a/src/spec.rs b/src/spec.rs -old mode 100755 -new mode 100644 diff --git a/rust-zip.spec b/rust-zip.spec index 896d1b3..5566197 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -28,8 +28,6 @@ Patch: zip-fix-metadata.diff # * Downstream-only: patch out tests that would need omitted test files to # compile Patch10: zip-2.1.4-omitted-test-files.patch -# * fix: remove executable bit -Patch11: https://github.com/zip-rs/zip2/commit/591ce5d044ab43c4daaaa7d20bcaa9e45112b11f.patch BuildRequires: cargo-rpm-macros >= 24 BuildRequires: tomcli diff --git a/rust2rpm.toml b/rust2rpm.toml index 49b832c..50955ec 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -39,13 +39,6 @@ comments = [ """, ] -[[package.extra-patches]] -number = 11 -file = "https://github.com/zip-rs/zip2/commit/591ce5d044ab43c4daaaa7d20bcaa9e45112b11f.patch" -comments = [ - "fix: remove executable bit", -] - [scripts.prep] post = [ "# Remove some benchmark-only and/or example-only dependencies", diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index 8fc6b96..2bd2a37 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,5 +1,5 @@ --- zip-2.2.3/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.2.3/Cargo.toml 2025-03-13T19:23:23.969319+00:00 ++++ zip-2.2.3/Cargo.toml 2025-03-13T19:35:51.690657+00:00 @@ -237,6 +237,3 @@ [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] version = "0.8.20" diff --git a/zip-fix-metadata.diff b/zip-fix-metadata.diff index 0ba595d..6e4b109 100644 --- a/zip-fix-metadata.diff +++ b/zip-fix-metadata.diff @@ -1,5 +1,5 @@ --- zip-2.2.3/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.2.3/Cargo.toml 2025-03-13T19:23:44.624340+00:00 ++++ zip-2.2.3/Cargo.toml 2025-03-13T19:35:51.692723+00:00 @@ -125,7 +125,7 @@ optional = true From 97e5cdce2e4565f8e32afd2a945c2333b19965bc Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 13 Mar 2025 20:27:12 -0400 Subject: [PATCH 11/28] Conditionalize a zip64 doctest (fix i686) --- 308.patch | 33 +++++++++++++++++++++++++++++++++ rust-zip.spec | 3 +++ rust2rpm.toml | 8 ++++++++ zip-fix-metadata-auto.diff | 2 +- zip-fix-metadata.diff | 2 +- 5 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 308.patch diff --git a/308.patch b/308.patch new file mode 100644 index 0000000..2cc7f1f --- /dev/null +++ b/308.patch @@ -0,0 +1,33 @@ +From ab5e5547302240ca3d5f9ef068ac003262e9ae67 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Thu, 13 Mar 2025 20:12:56 -0400 +Subject: [PATCH] fix(test): Conditionalize a zip64 doctest + +The doctest associated with `ZIP64_BYTES_THR` fails on 32-bit +architectures because `usize` is smaller than `u64`, so the expression +`(zip::ZIP64_BYTES_THR as usize) + 1` would overflow. +--- + src/spec.rs | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/spec.rs b/src/spec.rs +index 3d5318872..f3c3f73dc 100644 +--- a/src/spec.rs ++++ b/src/spec.rs +@@ -99,6 +99,8 @@ impl ExtraFieldMagic { + /// + ///``` + /// # fn main() -> Result<(), zip::result::ZipError> { ++/// # #[cfg(target_pointer_width = "64")] ++/// # { + /// use std::io::{self, Cursor, prelude::*}; + /// use std::error::Error; + /// use zip::{ZipWriter, write::SimpleFileOptions}; +@@ -129,6 +131,7 @@ impl ExtraFieldMagic { + /// zip.start_file("zero.dat", options)?; + /// // This succeeds because we specified that it could be a large file. + /// assert!(zip.write_all(&big_buf[..]).is_ok()); ++/// # } + /// # Ok(()) + /// # } + ///``` diff --git a/rust-zip.spec b/rust-zip.spec index 5566197..d6af683 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -28,6 +28,9 @@ Patch: zip-fix-metadata.diff # * Downstream-only: patch out tests that would need omitted test files to # compile Patch10: zip-2.1.4-omitted-test-files.patch +# * fix(test): Conditionalize a zip64 doctest +# * https://github.com/zip-rs/zip2/pull/308 +Patch11: https://github.com/zip-rs/zip2/pull/308.patch BuildRequires: cargo-rpm-macros >= 24 BuildRequires: tomcli diff --git a/rust2rpm.toml b/rust2rpm.toml index 50955ec..b7ecb30 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -39,6 +39,14 @@ comments = [ """, ] +[[package.extra-patches]] +number = 11 +file = "https://github.com/zip-rs/zip2/pull/308.patch" +comments = [ + "fix(test): Conditionalize a zip64 doctest", + "https://github.com/zip-rs/zip2/pull/308", +] + [scripts.prep] post = [ "# Remove some benchmark-only and/or example-only dependencies", diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index 2bd2a37..6f2c808 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,5 +1,5 @@ --- zip-2.2.3/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.2.3/Cargo.toml 2025-03-13T19:35:51.690657+00:00 ++++ zip-2.2.3/Cargo.toml 2025-03-14T00:26:07.838145+00:00 @@ -237,6 +237,3 @@ [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] version = "0.8.20" diff --git a/zip-fix-metadata.diff b/zip-fix-metadata.diff index 6e4b109..e6c9232 100644 --- a/zip-fix-metadata.diff +++ b/zip-fix-metadata.diff @@ -1,5 +1,5 @@ --- zip-2.2.3/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.2.3/Cargo.toml 2025-03-13T19:35:51.692723+00:00 ++++ zip-2.2.3/Cargo.toml 2025-03-14T00:26:07.840214+00:00 @@ -125,7 +125,7 @@ optional = true From 67a07956d6046fc3fea529ab5995c569dfb34a96 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 13 Mar 2025 21:20:01 -0400 Subject: [PATCH 12/28] Report and skip test failures on s390x --- rust-zip.spec | 13 +++++++++++++ rust2rpm.toml | 15 +++++++++++++++ zip-fix-metadata-auto.diff | 2 +- zip-fix-metadata.diff | 2 +- 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/rust-zip.spec b/rust-zip.spec index d6af683..f430112 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -417,7 +417,20 @@ done # Extract test data (only) from the GitHub archive tar -xzvf '%{SOURCE10}' --strip-components=1 'zip2-%{version}/tests/data/' cp -vp '%{SOURCE11}' tests/data/ +%ifnarch s390x %cargo_test -a +%else +# A few test failures on s390x (big-endian) +# https://github.com/zip-rs/zip2/issues/309 +%{cargo_test -a -- -- --exact %{shrink: + --skip write::test::fuzz_crash_2024_07_17 + --skip write::test::fuzz_crash_2024_07_19 + --skip write::test::test_deep_copy + --skip write::test::test_fuzz_crash_2024_06_17a + --skip write::test::test_fuzz_crash_2024_06_18b + --skip write::test::test_fuzz_failure_2024_06_08 +}} +%endif %endif %changelog diff --git a/rust2rpm.toml b/rust2rpm.toml index b7ecb30..f92a225 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -60,4 +60,19 @@ pre = [ "# Extract test data (only) from the GitHub archive", "tar -xzvf '%{SOURCE10}' --strip-components=1 'zip2-%{version}/tests/data/'", "cp -vp '%{SOURCE11}' tests/data/", + "%ifnarch s390x", +] +post = [ + "%else", + "# A few test failures on s390x (big-endian)", + "# https://github.com/zip-rs/zip2/issues/309", + "%{cargo_test -a -- -- --exact %{shrink:", + " --skip write::test::fuzz_crash_2024_07_17", + " --skip write::test::fuzz_crash_2024_07_19", + " --skip write::test::test_deep_copy", + " --skip write::test::test_fuzz_crash_2024_06_17a", + " --skip write::test::test_fuzz_crash_2024_06_18b", + " --skip write::test::test_fuzz_failure_2024_06_08", + "}}", + "%endif", ] diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index 6f2c808..566e992 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,5 +1,5 @@ --- zip-2.2.3/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.2.3/Cargo.toml 2025-03-14T00:26:07.838145+00:00 ++++ zip-2.2.3/Cargo.toml 2025-03-14T01:52:24.340408+00:00 @@ -237,6 +237,3 @@ [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] version = "0.8.20" diff --git a/zip-fix-metadata.diff b/zip-fix-metadata.diff index e6c9232..4719e76 100644 --- a/zip-fix-metadata.diff +++ b/zip-fix-metadata.diff @@ -1,5 +1,5 @@ --- zip-2.2.3/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.2.3/Cargo.toml 2025-03-14T00:26:07.840214+00:00 ++++ zip-2.2.3/Cargo.toml 2025-03-14T01:52:24.342846+00:00 @@ -125,7 +125,7 @@ optional = true From 8692bfd2d407b270e8073c75ff14176fe12a9dcb Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Sat, 15 Mar 2025 18:57:02 +0100 Subject: [PATCH 13/28] Minor rust2rpm config changes, don't rely on tomcli --- rust-zip.spec | 13 ++++------- rust2rpm.toml | 48 +++++++++++--------------------------- zip-fix-metadata-auto.diff | 2 +- zip-fix-metadata.diff | 37 ++++++++++++++++++++++++++++- 4 files changed, 56 insertions(+), 44 deletions(-) diff --git a/rust-zip.spec b/rust-zip.spec index f430112..c5b79dc 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -23,7 +23,8 @@ Source11: get_test_data.sh # Automatically generated patch to strip dependencies and normalize metadata Patch: zip-fix-metadata-auto.diff # Manually created patch for downstream crate metadata changes -# * For now, allow bzip2 0.4 (wants 0.5) +# * relax bzip2 dependency to allow building with both v0.4 and v0.5 +# * drop unused benchmark-only / example-only dev-dependencies Patch: zip-fix-metadata.diff # * Downstream-only: patch out tests that would need omitted test files to # compile @@ -33,7 +34,6 @@ Patch10: zip-2.1.4-omitted-test-files.patch Patch11: https://github.com/zip-rs/zip2/pull/308.patch BuildRequires: cargo-rpm-macros >= 24 -BuildRequires: tomcli %global _description %{expand: Library to support the reading and writing of zip files.} @@ -55,8 +55,10 @@ use the "%{crate}" crate. %doc %{crate_instdir}/CODE_OF_CONDUCT.md %doc %{crate_instdir}/CONTRIBUTING.md %doc %{crate_instdir}/README.md -%doc %{crate_instdir}/pull_request_template.md %{crate_instdir}/ +%exclude %{crate_instdir}/cliff.toml +%exclude %{crate_instdir}/pull_request_template.md +%exclude %{crate_instdir}/release-plz.toml %package -n %{name}+default-devel Summary: %{summary} @@ -397,11 +399,6 @@ use the "zstd" feature of the "%{crate}" crate. %prep %autosetup -n %{crate}-%{version} -p1 %cargo_prep -# Remove some benchmark-only and/or example-only dependencies -for dep in anyhow bencher clap getrandom walkdir -do - tomcli set Cargo.toml del "dev-dependencies.${dep}" -done %generate_buildrequires %cargo_generate_buildrequires -a diff --git a/rust2rpm.toml b/rust2rpm.toml index f92a225..61710e1 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -1,14 +1,13 @@ -[features] -enable-all = true - -[requires] -build = [ - "tomcli", -] - [package] cargo-toml-patch-comments = [ - "For now, allow bzip2 0.4 (wants 0.5)", + "relax bzip2 dependency to allow building with both v0.4 and v0.5", + "drop unused benchmark-only / example-only dev-dependencies", +] +doc-files.exclude = ["pull_request_template.md"] +exclude-crate-files = [ + "cliff.toml", + "pull_request_template.md", + "release-plz.toml", ] [[package.extra-sources]] @@ -47,32 +46,13 @@ comments = [ "https://github.com/zip-rs/zip2/pull/308", ] -[scripts.prep] -post = [ - "# Remove some benchmark-only and/or example-only dependencies", - "for dep in anyhow bencher clap getrandom walkdir", - "do", - " tomcli set Cargo.toml del \"dev-dependencies.${dep}\"", - "done", -] -[scripts.check] -pre = [ +[features] +enable-all = true + +[scripts] +check.pre = [ "# Extract test data (only) from the GitHub archive", "tar -xzvf '%{SOURCE10}' --strip-components=1 'zip2-%{version}/tests/data/'", "cp -vp '%{SOURCE11}' tests/data/", - "%ifnarch s390x", -] -post = [ - "%else", - "# A few test failures on s390x (big-endian)", - "# https://github.com/zip-rs/zip2/issues/309", - "%{cargo_test -a -- -- --exact %{shrink:", - " --skip write::test::fuzz_crash_2024_07_17", - " --skip write::test::fuzz_crash_2024_07_19", - " --skip write::test::test_deep_copy", - " --skip write::test::test_fuzz_crash_2024_06_17a", - " --skip write::test::test_fuzz_crash_2024_06_18b", - " --skip write::test::test_fuzz_failure_2024_06_08", - "}}", - "%endif", ] + diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index 566e992..46335c5 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,5 +1,5 @@ --- zip-2.2.3/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.2.3/Cargo.toml 2025-03-14T01:52:24.340408+00:00 ++++ zip-2.2.3/Cargo.toml 2025-03-15T17:56:19.140790+00:00 @@ -237,6 +237,3 @@ [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] version = "0.8.20" diff --git a/zip-fix-metadata.diff b/zip-fix-metadata.diff index 4719e76..bce65b9 100644 --- a/zip-fix-metadata.diff +++ b/zip-fix-metadata.diff @@ -1,5 +1,5 @@ --- zip-2.2.3/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.2.3/Cargo.toml 2025-03-14T01:52:24.342846+00:00 ++++ zip-2.2.3/Cargo.toml 2025-03-15T17:56:19.142950+00:00 @@ -125,7 +125,7 @@ optional = true @@ -9,3 +9,38 @@ optional = true [dependencies.chrono] +@@ -202,23 +202,6 @@ + version = "0.13" + optional = true + default-features = false +- +-[dev-dependencies.anyhow] +-version = "1.0.60" +- +-[dev-dependencies.bencher] +-version = "0.1.5" +- +-[dev-dependencies.clap] +-version = "=4.4.18" +-features = ["derive"] +- +-[dev-dependencies.getrandom] +-version = "0.2.15" +-features = [ +- "js", +- "std", +-] + + [dev-dependencies.tempfile] + version = "3.8" +@@ -230,10 +213,3 @@ + "macros", + ] + default-features = false +- +-[dev-dependencies.walkdir] +-version = "2.5" +- +-[target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] +-version = "0.8.20" +- From 718d4672feaccb73de518e901f84d6e6e91ce970 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 10 Apr 2025 11:35:22 -0400 Subject: [PATCH 14/28] Backport fix for s390x issues --- ...171e8bf4c5ed7c6ef6b14929cf258a8b011e.patch | 138 ++++++++++++++++++ rust-zip.spec | 16 +- rust2rpm.toml | 8 + zip-fix-metadata-auto.diff | 2 +- zip-fix-metadata.diff | 2 +- 5 files changed, 151 insertions(+), 15 deletions(-) create mode 100644 ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e.patch diff --git a/ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e.patch b/ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e.patch new file mode 100644 index 0000000..a2dd943 --- /dev/null +++ b/ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e.patch @@ -0,0 +1,138 @@ +From ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e Mon Sep 17 00:00:00 2001 +From: hennickc +Date: Tue, 18 Mar 2025 11:21:28 -0700 +Subject: [PATCH] fix: `deep_copy_file` produced a mangled file header on + big-endian platforms + +--- + src/write.rs | 52 ++++++++++++++++++++++++---------------------------- + 1 file changed, 24 insertions(+), 28 deletions(-) + +diff --git a/src/write.rs b/src/write.rs +index 082812a79..ccd3cc9d4 100644 +--- a/src/write.rs ++++ b/src/write.rs +@@ -3,11 +3,9 @@ + #[cfg(feature = "aes-crypto")] + use crate::aes::AesWriter; + use crate::compression::CompressionMethod; +-use crate::read::{ +- find_content, parse_single_extra_field, Config, ZipArchive, ZipFile, ZipFileReader, +-}; ++use crate::read::{parse_single_extra_field, Config, ZipArchive, ZipFile}; + use crate::result::{ZipError, ZipResult}; +-use crate::spec::{self, FixedSizeBlock, Pod, Zip32CDEBlock}; ++use crate::spec::{self, FixedSizeBlock, Zip32CDEBlock}; + #[cfg(feature = "aes-crypto")] + use crate::types::AesMode; + use crate::types::{ +@@ -689,13 +687,10 @@ impl ZipWriter { + compressed_size = write_position - src_data_start; + src_data.compressed_size = compressed_size; + } +- let mut reader = BufReader::new(ZipFileReader::Raw(find_content( +- src_data, +- self.inner.get_plain(), +- )?)); +- let mut copy = Vec::with_capacity(compressed_size as usize); +- reader.read_to_end(&mut copy)?; +- drop(reader); ++ let mut reader = BufReader::new(self.inner.get_plain()); ++ reader.seek(SeekFrom::Start(src_data_start))?; ++ let mut copy = vec![0; compressed_size as usize]; ++ reader.take(compressed_size).read_exact(&mut copy)?; + self.inner + .get_plain() + .seek(SeekFrom::Start(write_position))?; +@@ -718,25 +713,23 @@ impl ZipWriter { + new_data.central_header_start = 0; + let block = new_data.local_block()?; + let index = self.insert_file_data(new_data)?; +- let result = (|| { ++ let new_data = &self.files[index]; ++ let result: io::Result<()> = (|| { + let plain_writer = self.inner.get_plain(); +- plain_writer.write_all(block.as_bytes())?; +- plain_writer.write_all(dest_name_raw)?; +- let new_data = &self.files[index]; ++ block.write(plain_writer)?; ++ plain_writer.write_all(&new_data.file_name_raw)?; + if let Some(data) = &new_data.extra_field { + plain_writer.write_all(data)?; + } + debug_assert_eq!(data_start, plain_writer.stream_position()?); + self.writing_to_file = true; +- plain_writer.write_all(©) ++ plain_writer.write_all(©)?; ++ if self.flush_on_finish_file { ++ plain_writer.flush()?; ++ } ++ Ok(()) + })(); + self.ok_or_abort_file(result)?; +- +- // Copying will overwrite the central header +- self.files +- .values_mut() +- .for_each(|file| file.central_header_start = 0); +- + self.writing_to_file = false; + Ok(()) + } +@@ -1527,6 +1520,7 @@ impl ZipWriter { + let central_and_footer_size = footer_end - central_start; + writer.seek(SeekFrom::End(-(central_and_footer_size as i64)))?; + central_start = self.write_central_and_footer()?; ++ debug_assert!(self.inner.get_plain().stream_position()? == archive_end); + } + + Ok(central_start) +@@ -2292,8 +2286,10 @@ mod test { + writer + .deep_copy_file(RT_TEST_FILENAME, SECOND_FILENAME) + .unwrap(); +- let zip = writer.finish().unwrap(); +- let mut writer = ZipWriter::new_append(zip).unwrap(); ++ let zip = writer.finish().unwrap().into_inner(); ++ zip.iter().copied().for_each(|x| print!("{:02x}", x)); ++ println!(); ++ let mut writer = ZipWriter::new_append(Cursor::new(zip)).unwrap(); + writer + .deep_copy_file(RT_TEST_FILENAME, THIRD_FILENAME) + .unwrap(); +@@ -2599,7 +2595,7 @@ mod test { + Ok(()) + } + +- #[cfg(feature = "bzip2")] ++ #[cfg(all(feature = "bzip2", not(miri)))] + #[test] + fn test_fuzz_failure_2024_06_08() -> ZipResult<()> { + use crate::write::ExtendedFileOptions; +@@ -3230,7 +3226,7 @@ mod test { + + #[test] + #[allow(clippy::octal_escapes)] +- #[cfg(feature = "bzip2")] ++ #[cfg(all(feature = "bzip2", not(miri)))] + fn test_fuzz_crash_2024_06_17b() -> ZipResult<()> { + let mut writer = ZipWriter::new(Cursor::new(Vec::new())); + writer.set_flush_on_finish_file(false); +@@ -3421,7 +3417,7 @@ mod test { + Ok(()) + } + +- #[cfg(all(feature = "bzip2", feature = "aes-crypto"))] ++ #[cfg(all(feature = "bzip2", feature = "aes-crypto", not(miri)))] + #[test] + fn test_fuzz_crash_2024_06_18b() -> ZipResult<()> { + let mut writer = ZipWriter::new(Cursor::new(Vec::new())); +@@ -3548,7 +3544,7 @@ mod test { + } + + #[test] +- #[cfg(feature = "bzip2")] ++ #[cfg(all(feature = "bzip2", not(miri)))] + fn fuzz_crash_2024_07_17() -> ZipResult<()> { + let mut writer = ZipWriter::new(Cursor::new(Vec::new())); + writer.set_flush_on_finish_file(false); diff --git a/rust-zip.spec b/rust-zip.spec index c5b79dc..b0a58c3 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -32,6 +32,9 @@ Patch10: zip-2.1.4-omitted-test-files.patch # * fix(test): Conditionalize a zip64 doctest # * https://github.com/zip-rs/zip2/pull/308 Patch11: https://github.com/zip-rs/zip2/pull/308.patch +# * fix: deep_copy_file produced a mangled file header on big-endian platforms +# * https://github.com/zip-rs/zip2/commit/ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e +Patch12: https://github.com/zip-rs/zip2/commit/ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e.patch BuildRequires: cargo-rpm-macros >= 24 @@ -414,20 +417,7 @@ use the "zstd" feature of the "%{crate}" crate. # Extract test data (only) from the GitHub archive tar -xzvf '%{SOURCE10}' --strip-components=1 'zip2-%{version}/tests/data/' cp -vp '%{SOURCE11}' tests/data/ -%ifnarch s390x %cargo_test -a -%else -# A few test failures on s390x (big-endian) -# https://github.com/zip-rs/zip2/issues/309 -%{cargo_test -a -- -- --exact %{shrink: - --skip write::test::fuzz_crash_2024_07_17 - --skip write::test::fuzz_crash_2024_07_19 - --skip write::test::test_deep_copy - --skip write::test::test_fuzz_crash_2024_06_17a - --skip write::test::test_fuzz_crash_2024_06_18b - --skip write::test::test_fuzz_failure_2024_06_08 -}} -%endif %endif %changelog diff --git a/rust2rpm.toml b/rust2rpm.toml index 61710e1..66a98dc 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -46,6 +46,14 @@ comments = [ "https://github.com/zip-rs/zip2/pull/308", ] +[[package.extra-patches]] +number = 12 +file = "https://github.com/zip-rs/zip2/commit/ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e.patch" +comments = [ + "fix: deep_copy_file produced a mangled file header on big-endian platforms", + "https://github.com/zip-rs/zip2/commit/ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e", +] + [features] enable-all = true diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index 46335c5..3e1bc48 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,5 +1,5 @@ --- zip-2.2.3/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.2.3/Cargo.toml 2025-03-15T17:56:19.140790+00:00 ++++ zip-2.2.3/Cargo.toml 2025-04-10T15:34:48.896036+00:00 @@ -237,6 +237,3 @@ [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] version = "0.8.20" diff --git a/zip-fix-metadata.diff b/zip-fix-metadata.diff index bce65b9..c6e7495 100644 --- a/zip-fix-metadata.diff +++ b/zip-fix-metadata.diff @@ -1,5 +1,5 @@ --- zip-2.2.3/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.2.3/Cargo.toml 2025-03-15T17:56:19.142950+00:00 ++++ zip-2.2.3/Cargo.toml 2025-04-10T15:34:48.898979+00:00 @@ -125,7 +125,7 @@ optional = true From 775ec6634c4d81b09aee4489f8a6b0ded6475180 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 10 Apr 2025 11:43:03 -0400 Subject: [PATCH 15/28] No longer relax the bzip2 dependency --- rust-zip.spec | 1 - rust2rpm.toml | 1 - zip-fix-metadata-auto.diff | 2 +- zip-fix-metadata.diff | 19 +++++-------------- 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/rust-zip.spec b/rust-zip.spec index b0a58c3..808edce 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -23,7 +23,6 @@ Source11: get_test_data.sh # Automatically generated patch to strip dependencies and normalize metadata Patch: zip-fix-metadata-auto.diff # Manually created patch for downstream crate metadata changes -# * relax bzip2 dependency to allow building with both v0.4 and v0.5 # * drop unused benchmark-only / example-only dev-dependencies Patch: zip-fix-metadata.diff # * Downstream-only: patch out tests that would need omitted test files to diff --git a/rust2rpm.toml b/rust2rpm.toml index 66a98dc..d2a36a4 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -1,6 +1,5 @@ [package] cargo-toml-patch-comments = [ - "relax bzip2 dependency to allow building with both v0.4 and v0.5", "drop unused benchmark-only / example-only dev-dependencies", ] doc-files.exclude = ["pull_request_template.md"] diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index 3e1bc48..a3b7eb7 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,5 +1,5 @@ --- zip-2.2.3/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.2.3/Cargo.toml 2025-04-10T15:34:48.896036+00:00 ++++ zip-2.2.3/Cargo.toml 2025-04-10T15:42:38.421971+00:00 @@ -237,6 +237,3 @@ [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] version = "0.8.20" diff --git a/zip-fix-metadata.diff b/zip-fix-metadata.diff index c6e7495..aca1410 100644 --- a/zip-fix-metadata.diff +++ b/zip-fix-metadata.diff @@ -1,19 +1,9 @@ --- zip-2.2.3/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.2.3/Cargo.toml 2025-04-10T15:34:48.898979+00:00 -@@ -125,7 +125,7 @@ - optional = true - - [dependencies.bzip2] --version = "0.5.0" -+version = ">=0.4.4, <0.6.0" - optional = true - - [dependencies.chrono] -@@ -202,23 +202,6 @@ - version = "0.13" ++++ zip-2.2.3/Cargo.toml 2025-04-10T15:42:46.118228+00:00 +@@ -203,23 +203,6 @@ optional = true default-features = false -- + -[dev-dependencies.anyhow] -version = "1.0.60" - @@ -30,9 +20,10 @@ - "js", - "std", -] - +- [dev-dependencies.tempfile] version = "3.8" + @@ -230,10 +213,3 @@ "macros", ] From a14dda8cb8cae69df5ecb2788a94bd99b99b7dfe Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 10 Apr 2025 11:46:23 -0400 Subject: [PATCH 16/28] Update to version 2.3.0 --- .gitignore | 2 ++ 308.patch | 33 ------------------------ rust-zip.spec | 37 ++++++++++++++------------ rust2rpm.toml | 16 ++++++------ sources | 4 +-- zip-fix-metadata-auto.diff | 6 ++--- zip-fix-metadata.diff | 53 +++++++++++++++++++++++++++----------- 7 files changed, 73 insertions(+), 78 deletions(-) delete mode 100644 308.patch diff --git a/.gitignore b/.gitignore index 4b0f75c..0184871 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ /zip2-2.2.2-filtered.tar.gz /zip-2.2.3.crate /zip2-2.2.3-filtered.tar.gz +/zip-2.3.0.crate +/zip2-2.3.0-filtered.tar.gz diff --git a/308.patch b/308.patch deleted file mode 100644 index 2cc7f1f..0000000 --- a/308.patch +++ /dev/null @@ -1,33 +0,0 @@ -From ab5e5547302240ca3d5f9ef068ac003262e9ae67 Mon Sep 17 00:00:00 2001 -From: "Benjamin A. Beasley" -Date: Thu, 13 Mar 2025 20:12:56 -0400 -Subject: [PATCH] fix(test): Conditionalize a zip64 doctest - -The doctest associated with `ZIP64_BYTES_THR` fails on 32-bit -architectures because `usize` is smaller than `u64`, so the expression -`(zip::ZIP64_BYTES_THR as usize) + 1` would overflow. ---- - src/spec.rs | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/spec.rs b/src/spec.rs -index 3d5318872..f3c3f73dc 100644 ---- a/src/spec.rs -+++ b/src/spec.rs -@@ -99,6 +99,8 @@ impl ExtraFieldMagic { - /// - ///``` - /// # fn main() -> Result<(), zip::result::ZipError> { -+/// # #[cfg(target_pointer_width = "64")] -+/// # { - /// use std::io::{self, Cursor, prelude::*}; - /// use std::error::Error; - /// use zip::{ZipWriter, write::SimpleFileOptions}; -@@ -129,6 +131,7 @@ impl ExtraFieldMagic { - /// zip.start_file("zero.dat", options)?; - /// // This succeeds because we specified that it could be a large file. - /// assert!(zip.write_all(&big_buf[..]).is_ok()); -+/// # } - /// # Ok(()) - /// # } - ///``` diff --git a/rust-zip.spec b/rust-zip.spec index 808edce..a25cac9 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -5,7 +5,7 @@ %global crate zip Name: rust-zip -Version: 2.2.3 +Version: 2.3.0 Release: %autorelease Summary: Library to support the reading and writing of zip files @@ -24,16 +24,19 @@ Source11: get_test_data.sh Patch: zip-fix-metadata-auto.diff # Manually created patch for downstream crate metadata changes # * drop unused benchmark-only / example-only dev-dependencies +# * Remove the wasm_js feature from the getrandom dependency for the getrandom +# feature, and from the getrandom dev-dependency. Our rust-getrandom does not +# provide this feature; see also “Unconditional use of getrandom’s wasm_js +# feature is counter to upstream guidance,” +# https://github.com/zip-rs/zip2/issues/336. +# * patch out the nt-time features; rust-nt-time not yet packaged Patch: zip-fix-metadata.diff # * Downstream-only: patch out tests that would need omitted test files to # compile Patch10: zip-2.1.4-omitted-test-files.patch -# * fix(test): Conditionalize a zip64 doctest -# * https://github.com/zip-rs/zip2/pull/308 -Patch11: https://github.com/zip-rs/zip2/pull/308.patch # * fix: deep_copy_file produced a mangled file header on big-endian platforms # * https://github.com/zip-rs/zip2/commit/ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e -Patch12: https://github.com/zip-rs/zip2/commit/ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e.patch +Patch11: https://github.com/zip-rs/zip2/commit/ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e.patch BuildRequires: cargo-rpm-macros >= 24 @@ -254,6 +257,18 @@ use the "flate2" feature of the "%{crate}" crate. %files -n %{name}+flate2-devel %ghost %{crate_instdir}/Cargo.toml +%package -n %{name}+getrandom-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+getrandom-devel %{_description} + +This package contains library source intended for building other packages which +use the "getrandom" feature of the "%{crate}" crate. + +%files -n %{name}+getrandom-devel +%ghost %{crate_instdir}/Cargo.toml + %package -n %{name}+hmac-devel Summary: %{summary} BuildArch: noarch @@ -302,18 +317,6 @@ use the "pbkdf2" feature of the "%{crate}" crate. %files -n %{name}+pbkdf2-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+rand-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+rand-devel %{_description} - -This package contains library source intended for building other packages which -use the "rand" feature of the "%{crate}" crate. - -%files -n %{name}+rand-devel -%ghost %{crate_instdir}/Cargo.toml - %package -n %{name}+sha1-devel Summary: %{summary} BuildArch: noarch diff --git a/rust2rpm.toml b/rust2rpm.toml index d2a36a4..b845acd 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -1,6 +1,14 @@ [package] cargo-toml-patch-comments = [ "drop unused benchmark-only / example-only dev-dependencies", + """\ + Remove the wasm_js feature from the getrandom dependency for the getrandom \ + feature, and from the getrandom dev-dependency. Our rust-getrandom does not \ + provide this feature; see also “Unconditional use of getrandom’s wasm_js \ + feature is counter to upstream guidance,” \ + https://github.com/zip-rs/zip2/issues/336.\ + """, + "patch out the nt-time features; rust-nt-time not yet packaged", ] doc-files.exclude = ["pull_request_template.md"] exclude-crate-files = [ @@ -39,14 +47,6 @@ comments = [ [[package.extra-patches]] number = 11 -file = "https://github.com/zip-rs/zip2/pull/308.patch" -comments = [ - "fix(test): Conditionalize a zip64 doctest", - "https://github.com/zip-rs/zip2/pull/308", -] - -[[package.extra-patches]] -number = 12 file = "https://github.com/zip-rs/zip2/commit/ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e.patch" comments = [ "fix: deep_copy_file produced a mangled file header on big-endian platforms", diff --git a/sources b/sources index 7612542..e0bb526 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zip-2.2.3.crate) = 4c877d00fa49b896ff45b545bfe13d5d39163195a101a67e7a565ce3642b4d6d45bb01262f12c65b47d98a848e5248e7aa1c6556c6a01a7137643526292e2739 -SHA512 (zip2-2.2.3-filtered.tar.gz) = c90000416466c29ac7d87cccb2f44b466247bee1686b029697640547700e58259a99e3fda6dc999b2e04cf28728454172ff702511d258fad4075e88fb001b5d8 +SHA512 (zip-2.3.0.crate) = 26db908d221117dba0d8f82962c81e3b1b10742c1d1ee716c091be3b2e0a6a6c5077072c355d402d9ec0154d938a0e504cd96adec86fd8b2d3bb80c7e8d71826 +SHA512 (zip2-2.3.0-filtered.tar.gz) = eb9df1ecacb6ba0cab87ff3b5649a9ce655a6c05811bc4a1f9aa22ba52608ae4442db68eba9011724dc0dc9aeadc4705b22085ed7be1290bc37d3f36578c3a4b diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index a3b7eb7..7a16dd7 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,6 +1,6 @@ ---- zip-2.2.3/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.2.3/Cargo.toml 2025-04-10T15:42:38.421971+00:00 -@@ -237,6 +237,3 @@ +--- zip-2.3.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-2.3.0/Cargo.toml 2025-04-11T14:44:19.466340+00:00 +@@ -250,6 +250,3 @@ [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] version = "0.8.20" diff --git a/zip-fix-metadata.diff b/zip-fix-metadata.diff index aca1410..5970d12 100644 --- a/zip-fix-metadata.diff +++ b/zip-fix-metadata.diff @@ -1,6 +1,33 @@ ---- zip-2.2.3/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.2.3/Cargo.toml 2025-04-10T15:42:46.118228+00:00 -@@ -203,23 +203,6 @@ +--- zip-2.3.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-2.3.0/Cargo.toml 2025-04-11T14:44:33.068057+00:00 +@@ -98,7 +98,6 @@ + "_deflate-any", + ] + lzma = ["lzma-rs/stream"] +-nt-time = ["dep:nt-time"] + unreserved = [] + xz = ["dep:xz2"] + +@@ -156,7 +155,6 @@ + [dependencies.getrandom] + version = "0.3.1" + features = [ +- "wasm_js", + "std", + ] + optional = true +@@ -177,10 +175,6 @@ + [dependencies.memchr] + version = "2.7" + +-[dependencies.nt-time] +-version = "0.10.6" +-optional = true +- + [dependencies.pbkdf2] + version = "0.12" + optional = true +@@ -216,20 +210,9 @@ optional = true default-features = false @@ -14,21 +41,17 @@ -version = "=4.4.18" -features = ["derive"] - --[dev-dependencies.getrandom] --version = "0.2.15" --features = [ -- "js", -- "std", --] -- - [dev-dependencies.tempfile] - version = "3.8" + [dev-dependencies.getrandom] + version = "0.3.1" + features = [ +- "wasm_js", + "std", + ] -@@ -230,10 +213,3 @@ - "macros", +@@ -244,9 +227,3 @@ ] default-features = false -- + -[dev-dependencies.walkdir] -version = "2.5" - From 5bf0d5cd222a4e79f005c241c01c414b0744bb01 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 11 Apr 2025 13:09:08 -0400 Subject: [PATCH 17/28] Update to version 2.4.0 --- .gitignore | 2 ++ rust-zip.spec | 2 +- sources | 4 ++-- zip-fix-metadata-auto.diff | 10 +++++----- zip-fix-metadata.diff | 18 ++++++++++-------- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 0184871..0d19189 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ /zip2-2.2.3-filtered.tar.gz /zip-2.3.0.crate /zip2-2.3.0-filtered.tar.gz +/zip-2.4.0.crate +/zip2-2.4.0-filtered.tar.gz diff --git a/rust-zip.spec b/rust-zip.spec index a25cac9..95c415d 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -5,7 +5,7 @@ %global crate zip Name: rust-zip -Version: 2.3.0 +Version: 2.4.0 Release: %autorelease Summary: Library to support the reading and writing of zip files diff --git a/sources b/sources index e0bb526..d3bf52e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zip-2.3.0.crate) = 26db908d221117dba0d8f82962c81e3b1b10742c1d1ee716c091be3b2e0a6a6c5077072c355d402d9ec0154d938a0e504cd96adec86fd8b2d3bb80c7e8d71826 -SHA512 (zip2-2.3.0-filtered.tar.gz) = eb9df1ecacb6ba0cab87ff3b5649a9ce655a6c05811bc4a1f9aa22ba52608ae4442db68eba9011724dc0dc9aeadc4705b22085ed7be1290bc37d3f36578c3a4b +SHA512 (zip-2.4.0.crate) = 0a83a0b2afe465db38d7dad3403115f24ec9e3f2d5b512fdd32466d07b531448353837b43bce205fcbfb60f4aff09d215ed1928cee0d1842be4a4be9bfb813d6 +SHA512 (zip2-2.4.0-filtered.tar.gz) = d3ed108e4c3b9821e2d0b6033bd1049b7f60abf18efb37b3d080bf7210ec1e08dd4152ce6c2975bf89686f81b5ceecf1134c9fa7638f592abd6f8c45fef8e654 diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index 7a16dd7..0ad282b 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,9 +1,9 @@ ---- zip-2.3.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.3.0/Cargo.toml 2025-04-11T14:44:19.466340+00:00 -@@ -250,6 +250,3 @@ +--- zip-2.4.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-2.4.0/Cargo.toml 2025-04-11T17:06:59.553250+00:00 +@@ -251,6 +251,3 @@ [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] - version = "0.8.20" + version = "0.8.21" -[target."cfg(fuzzing)".dependencies.arbitrary] --version = "1.3.2" +-version = "1.4.1" -features = ["derive"] diff --git a/zip-fix-metadata.diff b/zip-fix-metadata.diff index 5970d12..f9614ef 100644 --- a/zip-fix-metadata.diff +++ b/zip-fix-metadata.diff @@ -1,5 +1,5 @@ ---- zip-2.3.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.3.0/Cargo.toml 2025-04-11T14:44:33.068057+00:00 +--- zip-2.4.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-2.4.0/Cargo.toml 2025-04-11T17:07:39.142859+00:00 @@ -98,7 +98,6 @@ "_deflate-any", ] @@ -16,23 +16,24 @@ "std", ] optional = true -@@ -177,10 +175,6 @@ +@@ -177,11 +175,6 @@ [dependencies.memchr] version = "2.7" -[dependencies.nt-time] -version = "0.10.6" -optional = true +-default-features = false - [dependencies.pbkdf2] version = "0.12" optional = true -@@ -216,20 +210,9 @@ +@@ -217,20 +210,9 @@ optional = true default-features = false -[dev-dependencies.anyhow] --version = "1.0.60" +-version = "1.0.95" - -[dev-dependencies.bencher] -version = "0.1.5" @@ -48,13 +49,14 @@ "std", ] -@@ -244,9 +227,3 @@ +@@ -244,10 +226,3 @@ + "macros", ] default-features = false - +- -[dev-dependencies.walkdir] -version = "2.5" - -[target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] --version = "0.8.20" +-version = "0.8.21" - From 963b8bd43881c9e2d2bb1b62fee467503e13b291 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 11 Apr 2025 13:13:54 -0400 Subject: [PATCH 18/28] Update to version 2.4.1 --- .gitignore | 2 ++ rust-zip.spec | 2 +- sources | 4 ++-- zip-fix-metadata-auto.diff | 4 ++-- zip-fix-metadata.diff | 4 ++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 0d19189..ce293b2 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ /zip2-2.3.0-filtered.tar.gz /zip-2.4.0.crate /zip2-2.4.0-filtered.tar.gz +/zip-2.4.1.crate +/zip2-2.4.1-filtered.tar.gz diff --git a/rust-zip.spec b/rust-zip.spec index 95c415d..68b3aa8 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -5,7 +5,7 @@ %global crate zip Name: rust-zip -Version: 2.4.0 +Version: 2.4.1 Release: %autorelease Summary: Library to support the reading and writing of zip files diff --git a/sources b/sources index d3bf52e..4115d13 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zip-2.4.0.crate) = 0a83a0b2afe465db38d7dad3403115f24ec9e3f2d5b512fdd32466d07b531448353837b43bce205fcbfb60f4aff09d215ed1928cee0d1842be4a4be9bfb813d6 -SHA512 (zip2-2.4.0-filtered.tar.gz) = d3ed108e4c3b9821e2d0b6033bd1049b7f60abf18efb37b3d080bf7210ec1e08dd4152ce6c2975bf89686f81b5ceecf1134c9fa7638f592abd6f8c45fef8e654 +SHA512 (zip-2.4.1.crate) = f18dade100b4128e69e9355cfc3712d07dcac6f4878778de744159aeb489afb8496312ed687e0a69dda166d1cefc64eeb4863ab5bb1161127ff1a4e7007df646 +SHA512 (zip2-2.4.1-filtered.tar.gz) = 1f5003ac03ba6e1ff212b34674a318595ef9d5f8da973079530b5cbe47d9f40653ae48798cc43e4fce79babf4c4ab0f4a8d9e9ecc2f6198d93d3c030c55e9153 diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index 0ad282b..812da1c 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,5 +1,5 @@ ---- zip-2.4.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.4.0/Cargo.toml 2025-04-11T17:06:59.553250+00:00 +--- zip-2.4.1/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-2.4.1/Cargo.toml 2025-04-11T17:13:15.820246+00:00 @@ -251,6 +251,3 @@ [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] version = "0.8.21" diff --git a/zip-fix-metadata.diff b/zip-fix-metadata.diff index f9614ef..60410dc 100644 --- a/zip-fix-metadata.diff +++ b/zip-fix-metadata.diff @@ -1,5 +1,5 @@ ---- zip-2.4.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.4.0/Cargo.toml 2025-04-11T17:07:39.142859+00:00 +--- zip-2.4.1/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-2.4.1/Cargo.toml 2025-04-11T17:13:15.821755+00:00 @@ -98,7 +98,6 @@ "_deflate-any", ] From 1392be47cb429d91d44bb37b2a675ce32e4bd07c Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 11 Apr 2025 13:20:09 -0400 Subject: [PATCH 19/28] Update to version 2.4.2 --- .gitignore | 2 + ...171e8bf4c5ed7c6ef6b14929cf258a8b011e.patch | 138 ------------------ rust-zip.spec | 6 +- rust2rpm.toml | 8 - sources | 4 +- zip-fix-metadata-auto.diff | 4 +- zip-fix-metadata.diff | 4 +- 7 files changed, 10 insertions(+), 156 deletions(-) delete mode 100644 ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e.patch diff --git a/.gitignore b/.gitignore index ce293b2..a9aa815 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,5 @@ /zip2-2.4.0-filtered.tar.gz /zip-2.4.1.crate /zip2-2.4.1-filtered.tar.gz +/zip-2.4.2.crate +/zip2-2.4.2-filtered.tar.gz diff --git a/ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e.patch b/ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e.patch deleted file mode 100644 index a2dd943..0000000 --- a/ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e.patch +++ /dev/null @@ -1,138 +0,0 @@ -From ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e Mon Sep 17 00:00:00 2001 -From: hennickc -Date: Tue, 18 Mar 2025 11:21:28 -0700 -Subject: [PATCH] fix: `deep_copy_file` produced a mangled file header on - big-endian platforms - ---- - src/write.rs | 52 ++++++++++++++++++++++++---------------------------- - 1 file changed, 24 insertions(+), 28 deletions(-) - -diff --git a/src/write.rs b/src/write.rs -index 082812a79..ccd3cc9d4 100644 ---- a/src/write.rs -+++ b/src/write.rs -@@ -3,11 +3,9 @@ - #[cfg(feature = "aes-crypto")] - use crate::aes::AesWriter; - use crate::compression::CompressionMethod; --use crate::read::{ -- find_content, parse_single_extra_field, Config, ZipArchive, ZipFile, ZipFileReader, --}; -+use crate::read::{parse_single_extra_field, Config, ZipArchive, ZipFile}; - use crate::result::{ZipError, ZipResult}; --use crate::spec::{self, FixedSizeBlock, Pod, Zip32CDEBlock}; -+use crate::spec::{self, FixedSizeBlock, Zip32CDEBlock}; - #[cfg(feature = "aes-crypto")] - use crate::types::AesMode; - use crate::types::{ -@@ -689,13 +687,10 @@ impl ZipWriter { - compressed_size = write_position - src_data_start; - src_data.compressed_size = compressed_size; - } -- let mut reader = BufReader::new(ZipFileReader::Raw(find_content( -- src_data, -- self.inner.get_plain(), -- )?)); -- let mut copy = Vec::with_capacity(compressed_size as usize); -- reader.read_to_end(&mut copy)?; -- drop(reader); -+ let mut reader = BufReader::new(self.inner.get_plain()); -+ reader.seek(SeekFrom::Start(src_data_start))?; -+ let mut copy = vec![0; compressed_size as usize]; -+ reader.take(compressed_size).read_exact(&mut copy)?; - self.inner - .get_plain() - .seek(SeekFrom::Start(write_position))?; -@@ -718,25 +713,23 @@ impl ZipWriter { - new_data.central_header_start = 0; - let block = new_data.local_block()?; - let index = self.insert_file_data(new_data)?; -- let result = (|| { -+ let new_data = &self.files[index]; -+ let result: io::Result<()> = (|| { - let plain_writer = self.inner.get_plain(); -- plain_writer.write_all(block.as_bytes())?; -- plain_writer.write_all(dest_name_raw)?; -- let new_data = &self.files[index]; -+ block.write(plain_writer)?; -+ plain_writer.write_all(&new_data.file_name_raw)?; - if let Some(data) = &new_data.extra_field { - plain_writer.write_all(data)?; - } - debug_assert_eq!(data_start, plain_writer.stream_position()?); - self.writing_to_file = true; -- plain_writer.write_all(©) -+ plain_writer.write_all(©)?; -+ if self.flush_on_finish_file { -+ plain_writer.flush()?; -+ } -+ Ok(()) - })(); - self.ok_or_abort_file(result)?; -- -- // Copying will overwrite the central header -- self.files -- .values_mut() -- .for_each(|file| file.central_header_start = 0); -- - self.writing_to_file = false; - Ok(()) - } -@@ -1527,6 +1520,7 @@ impl ZipWriter { - let central_and_footer_size = footer_end - central_start; - writer.seek(SeekFrom::End(-(central_and_footer_size as i64)))?; - central_start = self.write_central_and_footer()?; -+ debug_assert!(self.inner.get_plain().stream_position()? == archive_end); - } - - Ok(central_start) -@@ -2292,8 +2286,10 @@ mod test { - writer - .deep_copy_file(RT_TEST_FILENAME, SECOND_FILENAME) - .unwrap(); -- let zip = writer.finish().unwrap(); -- let mut writer = ZipWriter::new_append(zip).unwrap(); -+ let zip = writer.finish().unwrap().into_inner(); -+ zip.iter().copied().for_each(|x| print!("{:02x}", x)); -+ println!(); -+ let mut writer = ZipWriter::new_append(Cursor::new(zip)).unwrap(); - writer - .deep_copy_file(RT_TEST_FILENAME, THIRD_FILENAME) - .unwrap(); -@@ -2599,7 +2595,7 @@ mod test { - Ok(()) - } - -- #[cfg(feature = "bzip2")] -+ #[cfg(all(feature = "bzip2", not(miri)))] - #[test] - fn test_fuzz_failure_2024_06_08() -> ZipResult<()> { - use crate::write::ExtendedFileOptions; -@@ -3230,7 +3226,7 @@ mod test { - - #[test] - #[allow(clippy::octal_escapes)] -- #[cfg(feature = "bzip2")] -+ #[cfg(all(feature = "bzip2", not(miri)))] - fn test_fuzz_crash_2024_06_17b() -> ZipResult<()> { - let mut writer = ZipWriter::new(Cursor::new(Vec::new())); - writer.set_flush_on_finish_file(false); -@@ -3421,7 +3417,7 @@ mod test { - Ok(()) - } - -- #[cfg(all(feature = "bzip2", feature = "aes-crypto"))] -+ #[cfg(all(feature = "bzip2", feature = "aes-crypto", not(miri)))] - #[test] - fn test_fuzz_crash_2024_06_18b() -> ZipResult<()> { - let mut writer = ZipWriter::new(Cursor::new(Vec::new())); -@@ -3548,7 +3544,7 @@ mod test { - } - - #[test] -- #[cfg(feature = "bzip2")] -+ #[cfg(all(feature = "bzip2", not(miri)))] - fn fuzz_crash_2024_07_17() -> ZipResult<()> { - let mut writer = ZipWriter::new(Cursor::new(Vec::new())); - writer.set_flush_on_finish_file(false); diff --git a/rust-zip.spec b/rust-zip.spec index 68b3aa8..799a46c 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -5,7 +5,7 @@ %global crate zip Name: rust-zip -Version: 2.4.1 +Version: 2.4.2 Release: %autorelease Summary: Library to support the reading and writing of zip files @@ -34,9 +34,6 @@ Patch: zip-fix-metadata.diff # * Downstream-only: patch out tests that would need omitted test files to # compile Patch10: zip-2.1.4-omitted-test-files.patch -# * fix: deep_copy_file produced a mangled file header on big-endian platforms -# * https://github.com/zip-rs/zip2/commit/ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e -Patch11: https://github.com/zip-rs/zip2/commit/ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e.patch BuildRequires: cargo-rpm-macros >= 24 @@ -60,6 +57,7 @@ use the "%{crate}" crate. %doc %{crate_instdir}/CODE_OF_CONDUCT.md %doc %{crate_instdir}/CONTRIBUTING.md %doc %{crate_instdir}/README.md +%doc %{crate_instdir}/SECURITY.md %{crate_instdir}/ %exclude %{crate_instdir}/cliff.toml %exclude %{crate_instdir}/pull_request_template.md diff --git a/rust2rpm.toml b/rust2rpm.toml index b845acd..4b5018a 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -45,14 +45,6 @@ comments = [ """, ] -[[package.extra-patches]] -number = 11 -file = "https://github.com/zip-rs/zip2/commit/ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e.patch" -comments = [ - "fix: deep_copy_file produced a mangled file header on big-endian platforms", - "https://github.com/zip-rs/zip2/commit/ed78171e8bf4c5ed7c6ef6b14929cf258a8b011e", -] - [features] enable-all = true diff --git a/sources b/sources index 4115d13..9c6d78a 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zip-2.4.1.crate) = f18dade100b4128e69e9355cfc3712d07dcac6f4878778de744159aeb489afb8496312ed687e0a69dda166d1cefc64eeb4863ab5bb1161127ff1a4e7007df646 -SHA512 (zip2-2.4.1-filtered.tar.gz) = 1f5003ac03ba6e1ff212b34674a318595ef9d5f8da973079530b5cbe47d9f40653ae48798cc43e4fce79babf4c4ab0f4a8d9e9ecc2f6198d93d3c030c55e9153 +SHA512 (zip-2.4.2.crate) = fdf4c182c3b22089107d984327a1205c010d57e193311d025f77c8349767bbeb8b848b56fa52d5ed6e9bdb3a5c32ea3454b763e7fe83eaebe90b9e32cfa97ffe +SHA512 (zip2-2.4.2-filtered.tar.gz) = fb0bd29c8852892a3fee5eb5af6720b08f6968143875efcecdc2f59b231b9103c1580b51aeda670649636c8054616829312d808b5e83c227a56ecea6ed1c0fc9 diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index 812da1c..3e8b8f6 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,5 +1,5 @@ ---- zip-2.4.1/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.4.1/Cargo.toml 2025-04-11T17:13:15.820246+00:00 +--- zip-2.4.2/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-2.4.2/Cargo.toml 2025-04-11T17:19:29.798249+00:00 @@ -251,6 +251,3 @@ [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] version = "0.8.21" diff --git a/zip-fix-metadata.diff b/zip-fix-metadata.diff index 60410dc..94d2374 100644 --- a/zip-fix-metadata.diff +++ b/zip-fix-metadata.diff @@ -1,5 +1,5 @@ ---- zip-2.4.1/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.4.1/Cargo.toml 2025-04-11T17:13:15.821755+00:00 +--- zip-2.4.2/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-2.4.2/Cargo.toml 2025-04-11T17:19:29.800375+00:00 @@ -98,7 +98,6 @@ "_deflate-any", ] From ea68e69c8ba479d9a7e4feb1f512ef2e6fb1503f Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 11 Apr 2025 13:24:35 -0400 Subject: [PATCH 20/28] Update to version 2.5.0 --- .gitignore | 2 ++ rust-zip.spec | 26 +++++++++++++++++++++++++- sources | 4 ++-- zip-fix-metadata-auto.diff | 6 +++--- zip-fix-metadata.diff | 16 ++++++++-------- 5 files changed, 40 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index a9aa815..a8d5b96 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,5 @@ /zip2-2.4.1-filtered.tar.gz /zip-2.4.2.crate /zip2-2.4.2-filtered.tar.gz +/zip-2.5.0.crate +/zip2-2.5.0-filtered.tar.gz diff --git a/rust-zip.spec b/rust-zip.spec index 799a46c..ffb7357 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -5,7 +5,7 @@ %global crate zip Name: rust-zip -Version: 2.4.2 +Version: 2.5.0 Release: %autorelease Summary: Library to support the reading and writing of zip files @@ -279,6 +279,18 @@ use the "hmac" feature of the "%{crate}" crate. %files -n %{name}+hmac-devel %ghost %{crate_instdir}/Cargo.toml +%package -n %{name}+jiff-02-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+jiff-02-devel %{_description} + +This package contains library source intended for building other packages which +use the "jiff-02" feature of the "%{crate}" crate. + +%files -n %{name}+jiff-02-devel +%ghost %{crate_instdir}/Cargo.toml + %package -n %{name}+lzma-devel Summary: %{summary} BuildArch: noarch @@ -315,6 +327,18 @@ use the "pbkdf2" feature of the "%{crate}" crate. %files -n %{name}+pbkdf2-devel %ghost %{crate_instdir}/Cargo.toml +%package -n %{name}+proc-macro2-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+proc-macro2-devel %{_description} + +This package contains library source intended for building other packages which +use the "proc-macro2" feature of the "%{crate}" crate. + +%files -n %{name}+proc-macro2-devel +%ghost %{crate_instdir}/Cargo.toml + %package -n %{name}+sha1-devel Summary: %{summary} BuildArch: noarch diff --git a/sources b/sources index 9c6d78a..39a2df0 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zip-2.4.2.crate) = fdf4c182c3b22089107d984327a1205c010d57e193311d025f77c8349767bbeb8b848b56fa52d5ed6e9bdb3a5c32ea3454b763e7fe83eaebe90b9e32cfa97ffe -SHA512 (zip2-2.4.2-filtered.tar.gz) = fb0bd29c8852892a3fee5eb5af6720b08f6968143875efcecdc2f59b231b9103c1580b51aeda670649636c8054616829312d808b5e83c227a56ecea6ed1c0fc9 +SHA512 (zip-2.5.0.crate) = dbe3d7570e11aac1a166e67d827239386a367a4ee2d3c1f71c6caf034be87ae19f7024e3e74d906f165ad77ec3a92265fb65fb373f48a2b900a518b2615c7937 +SHA512 (zip2-2.5.0-filtered.tar.gz) = 47073d0438b724dc7774bf46abd0aafe13ba850d12a10ed93ad37a2357f15b8802eb70612e1c2145fe0d7ecb9e051e1e91e3fbf2c20717ad4f04c4f360a30e6d diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index 3e8b8f6..14fc2fe 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,6 +1,6 @@ ---- zip-2.4.2/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.4.2/Cargo.toml 2025-04-11T17:19:29.798249+00:00 -@@ -251,6 +251,3 @@ +--- zip-2.5.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-2.5.0/Cargo.toml 2025-04-11T17:23:41.622547+00:00 +@@ -253,6 +253,3 @@ [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] version = "0.8.21" diff --git a/zip-fix-metadata.diff b/zip-fix-metadata.diff index 94d2374..09d5246 100644 --- a/zip-fix-metadata.diff +++ b/zip-fix-metadata.diff @@ -1,14 +1,14 @@ ---- zip-2.4.2/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.4.2/Cargo.toml 2025-04-11T17:19:29.800375+00:00 -@@ -98,7 +98,6 @@ - "_deflate-any", +--- zip-2.5.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-2.5.0/Cargo.toml 2025-04-11T17:23:41.623991+00:00 +@@ -99,7 +99,6 @@ ] + jiff-02 = ["dep:jiff"] lzma = ["lzma-rs/stream"] -nt-time = ["dep:nt-time"] unreserved = [] xz = ["dep:xz2"] -@@ -156,7 +155,6 @@ +@@ -153,7 +152,6 @@ [dependencies.getrandom] version = "0.3.1" features = [ @@ -16,7 +16,7 @@ "std", ] optional = true -@@ -177,11 +175,6 @@ +@@ -178,11 +176,6 @@ [dependencies.memchr] version = "2.7" @@ -28,7 +28,7 @@ [dependencies.pbkdf2] version = "0.12" optional = true -@@ -217,20 +210,9 @@ +@@ -219,20 +212,9 @@ optional = true default-features = false @@ -49,7 +49,7 @@ "std", ] -@@ -244,10 +226,3 @@ +@@ -246,10 +228,3 @@ "macros", ] default-features = false From 3f168b27ca5bfd5446ae9de3d40c6979e301304e Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 11 Apr 2025 13:29:15 -0400 Subject: [PATCH 21/28] Update to version 2.6.0 --- .gitignore | 2 ++ rust-zip.spec | 2 +- sources | 4 ++-- zip-fix-metadata-auto.diff | 4 ++-- zip-fix-metadata.diff | 4 ++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index a8d5b96..4b7c422 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,5 @@ /zip2-2.4.2-filtered.tar.gz /zip-2.5.0.crate /zip2-2.5.0-filtered.tar.gz +/zip-2.6.0.crate +/zip2-2.6.0-filtered.tar.gz diff --git a/rust-zip.spec b/rust-zip.spec index ffb7357..788d9ba 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -5,7 +5,7 @@ %global crate zip Name: rust-zip -Version: 2.5.0 +Version: 2.6.0 Release: %autorelease Summary: Library to support the reading and writing of zip files diff --git a/sources b/sources index 39a2df0..421bc63 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zip-2.5.0.crate) = dbe3d7570e11aac1a166e67d827239386a367a4ee2d3c1f71c6caf034be87ae19f7024e3e74d906f165ad77ec3a92265fb65fb373f48a2b900a518b2615c7937 -SHA512 (zip2-2.5.0-filtered.tar.gz) = 47073d0438b724dc7774bf46abd0aafe13ba850d12a10ed93ad37a2357f15b8802eb70612e1c2145fe0d7ecb9e051e1e91e3fbf2c20717ad4f04c4f360a30e6d +SHA512 (zip-2.6.0.crate) = cbfd545ddfab879ae72c35f1abe7c7daf4f6f11469f453d28cc087425ce07d3cb48bec42142bdb46e491a51c4de004cd078c7394d97d28ef820fbdedc0c70f05 +SHA512 (zip2-2.6.0-filtered.tar.gz) = 99d3e3be914996335d0a35cf1bf420a7ea667cb4cb84928f5957a1be5213bf381e39b44428b09b40fe885ff46cec1c0617b7597e0674e6963e42f2d65b18a4d7 diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index 14fc2fe..4d37cdf 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,5 +1,5 @@ ---- zip-2.5.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.5.0/Cargo.toml 2025-04-11T17:23:41.622547+00:00 +--- zip-2.6.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-2.6.0/Cargo.toml 2025-04-11T17:28:40.444139+00:00 @@ -253,6 +253,3 @@ [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] version = "0.8.21" diff --git a/zip-fix-metadata.diff b/zip-fix-metadata.diff index 09d5246..6407428 100644 --- a/zip-fix-metadata.diff +++ b/zip-fix-metadata.diff @@ -1,5 +1,5 @@ ---- zip-2.5.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.5.0/Cargo.toml 2025-04-11T17:23:41.623991+00:00 +--- zip-2.6.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-2.6.0/Cargo.toml 2025-04-11T17:28:40.445391+00:00 @@ -99,7 +99,6 @@ ] jiff-02 = ["dep:jiff"] From 56358d4ce46ca051e9e902b3dbf24a78d00b921a Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 11 Apr 2025 13:32:27 -0400 Subject: [PATCH 22/28] Update to version 2.6.1; Fixes RHBZ#2352783 --- .gitignore | 2 ++ rust-zip.spec | 2 +- sources | 4 ++-- zip-fix-metadata-auto.diff | 4 ++-- zip-fix-metadata.diff | 4 ++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 4b7c422..1134e82 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,5 @@ /zip2-2.5.0-filtered.tar.gz /zip-2.6.0.crate /zip2-2.6.0-filtered.tar.gz +/zip-2.6.1.crate +/zip2-2.6.1-filtered.tar.gz diff --git a/rust-zip.spec b/rust-zip.spec index 788d9ba..9aa6537 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -5,7 +5,7 @@ %global crate zip Name: rust-zip -Version: 2.6.0 +Version: 2.6.1 Release: %autorelease Summary: Library to support the reading and writing of zip files diff --git a/sources b/sources index 421bc63..874bf89 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zip-2.6.0.crate) = cbfd545ddfab879ae72c35f1abe7c7daf4f6f11469f453d28cc087425ce07d3cb48bec42142bdb46e491a51c4de004cd078c7394d97d28ef820fbdedc0c70f05 -SHA512 (zip2-2.6.0-filtered.tar.gz) = 99d3e3be914996335d0a35cf1bf420a7ea667cb4cb84928f5957a1be5213bf381e39b44428b09b40fe885ff46cec1c0617b7597e0674e6963e42f2d65b18a4d7 +SHA512 (zip-2.6.1.crate) = 60393af7bfccbc9b797f9b433b72d45a262a50c8097dfa6b91b3508185f2c95dcf575d2f2bc2962721b6ad5fb36618f92e36ab55e74a6034ebf131d7a35decd2 +SHA512 (zip2-2.6.1-filtered.tar.gz) = bc059864af3c45ce913eb59a8b21ea880204b9b016e5c06924055b3b05263d604fc5c28426c44a972bc3799febd3ea05eef0718700e903c9f0d17bf0a4baf223 diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index 4d37cdf..de0416f 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,5 +1,5 @@ ---- zip-2.6.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.6.0/Cargo.toml 2025-04-11T17:28:40.444139+00:00 +--- zip-2.6.1/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-2.6.1/Cargo.toml 2025-04-11T17:31:37.490018+00:00 @@ -253,6 +253,3 @@ [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] version = "0.8.21" diff --git a/zip-fix-metadata.diff b/zip-fix-metadata.diff index 6407428..d61ac01 100644 --- a/zip-fix-metadata.diff +++ b/zip-fix-metadata.diff @@ -1,5 +1,5 @@ ---- zip-2.6.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.6.0/Cargo.toml 2025-04-11T17:28:40.445391+00:00 +--- zip-2.6.1/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-2.6.1/Cargo.toml 2025-04-11T17:31:37.491868+00:00 @@ -99,7 +99,6 @@ ] jiff-02 = ["dep:jiff"] From b477c068b0668a4581ad1fedb94ed4da0e364d12 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 16 May 2025 07:20:40 -0400 Subject: [PATCH 23/28] Update to version 3.0.0; Fixes RHBZ#2366379 --- .gitignore | 2 + rust-zip.spec | 56 ++++--------------- rust2rpm.toml | 2 +- sources | 4 +- ...atch => zip-3.0.0-omitted-test-files.patch | 8 +-- zip-fix-metadata-auto.diff | 10 ++-- zip-fix-metadata.diff | 20 +++---- 7 files changed, 32 insertions(+), 70 deletions(-) rename zip-2.1.4-omitted-test-files.patch => zip-3.0.0-omitted-test-files.patch (55%) diff --git a/.gitignore b/.gitignore index 1134e82..ace15fb 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,5 @@ /zip2-2.6.0-filtered.tar.gz /zip-2.6.1.crate /zip2-2.6.1-filtered.tar.gz +/zip-3.0.0.crate +/zip2-3.0.0-filtered.tar.gz diff --git a/rust-zip.spec b/rust-zip.spec index 9aa6537..e62e4ff 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -5,7 +5,7 @@ %global crate zip Name: rust-zip -Version: 2.6.1 +Version: 3.0.0 Release: %autorelease Summary: Library to support the reading and writing of zip files @@ -33,7 +33,7 @@ Patch: zip-fix-metadata-auto.diff Patch: zip-fix-metadata.diff # * Downstream-only: patch out tests that would need omitted test files to # compile -Patch10: zip-2.1.4-omitted-test-files.patch +Patch10: zip-3.0.0-omitted-test-files.patch BuildRequires: cargo-rpm-macros >= 24 @@ -183,40 +183,28 @@ use the "deflate-flate2" feature of the "%{crate}" crate. %files -n %{name}+deflate-flate2-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+deflate-miniz-devel +%package -n %{name}+deflate-flate2-zlib-devel Summary: %{summary} BuildArch: noarch -%description -n %{name}+deflate-miniz-devel %{_description} +%description -n %{name}+deflate-flate2-zlib-devel %{_description} This package contains library source intended for building other packages which -use the "deflate-miniz" feature of the "%{crate}" crate. +use the "deflate-flate2-zlib" feature of the "%{crate}" crate. -%files -n %{name}+deflate-miniz-devel +%files -n %{name}+deflate-flate2-zlib-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+deflate-zlib-devel +%package -n %{name}+deflate-flate2-zlib-rs-devel Summary: %{summary} BuildArch: noarch -%description -n %{name}+deflate-zlib-devel %{_description} +%description -n %{name}+deflate-flate2-zlib-rs-devel %{_description} This package contains library source intended for building other packages which -use the "deflate-zlib" feature of the "%{crate}" crate. +use the "deflate-flate2-zlib-rs" feature of the "%{crate}" crate. -%files -n %{name}+deflate-zlib-devel -%ghost %{crate_instdir}/Cargo.toml - -%package -n %{name}+deflate-zlib-ng-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+deflate-zlib-ng-devel %{_description} - -This package contains library source intended for building other packages which -use the "deflate-zlib-ng" feature of the "%{crate}" crate. - -%files -n %{name}+deflate-zlib-ng-devel +%files -n %{name}+deflate-flate2-zlib-rs-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+deflate-zopfli-devel @@ -243,18 +231,6 @@ use the "deflate64" feature of the "%{crate}" crate. %files -n %{name}+deflate64-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+flate2-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+flate2-devel %{_description} - -This package contains library source intended for building other packages which -use the "flate2" feature of the "%{crate}" crate. - -%files -n %{name}+flate2-devel -%ghost %{crate_instdir}/Cargo.toml - %package -n %{name}+getrandom-devel Summary: %{summary} BuildArch: noarch @@ -327,18 +303,6 @@ use the "pbkdf2" feature of the "%{crate}" crate. %files -n %{name}+pbkdf2-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+proc-macro2-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+proc-macro2-devel %{_description} - -This package contains library source intended for building other packages which -use the "proc-macro2" feature of the "%{crate}" crate. - -%files -n %{name}+proc-macro2-devel -%ghost %{crate_instdir}/Cargo.toml - %package -n %{name}+sha1-devel Summary: %{summary} BuildArch: noarch diff --git a/rust2rpm.toml b/rust2rpm.toml index 4b5018a..ae2e4ab 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -37,7 +37,7 @@ comments = [ [[package.extra-patches]] number = 10 -file = "zip-2.1.4-omitted-test-files.patch" +file = "zip-3.0.0-omitted-test-files.patch" comments = [ """\ Downstream-only: patch out tests that would need omitted test files to \ diff --git a/sources b/sources index 874bf89..8fa925c 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zip-2.6.1.crate) = 60393af7bfccbc9b797f9b433b72d45a262a50c8097dfa6b91b3508185f2c95dcf575d2f2bc2962721b6ad5fb36618f92e36ab55e74a6034ebf131d7a35decd2 -SHA512 (zip2-2.6.1-filtered.tar.gz) = bc059864af3c45ce913eb59a8b21ea880204b9b016e5c06924055b3b05263d604fc5c28426c44a972bc3799febd3ea05eef0718700e903c9f0d17bf0a4baf223 +SHA512 (zip-3.0.0.crate) = 64e0952ab5232a4c36e0f7c019fefd382f0373d2e7bbcdbe026bad522e14d9e483aa75793e9f592371497e068ba416a6939ef242223ed387c4d077a3ca044bc5 +SHA512 (zip2-3.0.0-filtered.tar.gz) = 8eb13dae727299566790ba067ebd85686fe62f4474cdfa8ac4d18c39d56c5fd258aba0d2f3babae1c6378f17d2e620c35dbb9e4afdc636fd45bf1b2924c6058d diff --git a/zip-2.1.4-omitted-test-files.patch b/zip-3.0.0-omitted-test-files.patch similarity index 55% rename from zip-2.1.4-omitted-test-files.patch rename to zip-3.0.0-omitted-test-files.patch index 50da969..876a903 100644 --- a/zip-2.1.4-omitted-test-files.patch +++ b/zip-3.0.0-omitted-test-files.patch @@ -1,10 +1,10 @@ -diff -Naur zip-2.1.4-original/src/read.rs zip-2.1.4/src/read.rs ---- zip-2.1.4-original/src/read.rs 2006-07-23 21:21:28.000000000 -0400 -+++ zip-2.1.4/src/read.rs 2025-03-13 14:43:54.173101323 -0400 +diff -Naur zip-3.0.0-original/src/read.rs zip-3.0.0/src/read.rs +--- zip-3.0.0-original/src/read.rs 2006-07-23 21:21:28.000000000 -0400 ++++ zip-3.0.0/src/read.rs 2025-05-16 07:16:07.587241056 -0400 @@ -2170,6 +2170,8 @@ #[test] - #[cfg(feature = "_deflate-any")] + #[cfg(feature = "deflate-flate2")] + // Downstream patch: we do not include the test file needed for this test. + #[cfg(any())] fn test_utf8_extra_field() { diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index de0416f..fa93a29 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,8 +1,8 @@ ---- zip-2.6.1/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.6.1/Cargo.toml 2025-04-11T17:31:37.490018+00:00 -@@ -253,6 +253,3 @@ - [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] - version = "0.8.21" +--- zip-3.0.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-3.0.0/Cargo.toml 2025-05-16T11:17:25.429348+00:00 +@@ -244,6 +244,3 @@ + [dev-dependencies.walkdir] + version = "2.5" -[target."cfg(fuzzing)".dependencies.arbitrary] -version = "1.4.1" diff --git a/zip-fix-metadata.diff b/zip-fix-metadata.diff index d61ac01..95bfdb7 100644 --- a/zip-fix-metadata.diff +++ b/zip-fix-metadata.diff @@ -1,6 +1,6 @@ ---- zip-2.6.1/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-2.6.1/Cargo.toml 2025-04-11T17:31:37.491868+00:00 -@@ -99,7 +99,6 @@ +--- zip-3.0.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-3.0.0/Cargo.toml 2025-05-16T11:17:25.430552+00:00 +@@ -97,7 +97,6 @@ ] jiff-02 = ["dep:jiff"] lzma = ["lzma-rs/stream"] @@ -8,7 +8,7 @@ unreserved = [] xz = ["dep:xz2"] -@@ -153,7 +152,6 @@ +@@ -151,7 +150,6 @@ [dependencies.getrandom] version = "0.3.1" features = [ @@ -16,7 +16,7 @@ "std", ] optional = true -@@ -178,11 +176,6 @@ +@@ -176,11 +174,6 @@ [dependencies.memchr] version = "2.7" @@ -28,7 +28,7 @@ [dependencies.pbkdf2] version = "0.12" optional = true -@@ -219,20 +212,9 @@ +@@ -213,20 +206,9 @@ optional = true default-features = false @@ -49,14 +49,10 @@ "std", ] -@@ -246,10 +228,3 @@ - "macros", +@@ -241,6 +223,3 @@ ] default-features = false -- + -[dev-dependencies.walkdir] -version = "2.5" - --[target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies.crossbeam-utils] --version = "0.8.21" -- From c9ee9db6dbf37dffc68d47392af2c7f06ab9de4a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 17:48:24 +0000 Subject: [PATCH 24/28] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From d548fd6052d4956cc6b968f1eb0f9ef5ef32577b Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 16 Dec 2025 12:37:39 +0000 Subject: [PATCH 25/28] Allow bzip2 0.6 --- rust-zip.spec | 5 ++++- rust2rpm.toml | 5 +++++ zip-fix-metadata-auto.diff | 2 +- zip-fix-metadata.diff | 11 ++++++++++- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/rust-zip.spec b/rust-zip.spec index e62e4ff..7ec653b 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -1,4 +1,4 @@ -# Generated by rust2rpm 27 +# Generated by rust2rpm 28 %bcond check 1 %global debug_package %{nil} @@ -30,6 +30,9 @@ Patch: zip-fix-metadata-auto.diff # feature is counter to upstream guidance,” # https://github.com/zip-rs/zip2/issues/336. # * patch out the nt-time features; rust-nt-time not yet packaged +# * allow bzip2 0.6; see +# https://github.com/zip-rs/zip2/commit/c8278990c40ddfbeb4a23877c1221792535d21b3, +# released upstream in 4.3.0 Patch: zip-fix-metadata.diff # * Downstream-only: patch out tests that would need omitted test files to # compile diff --git a/rust2rpm.toml b/rust2rpm.toml index ae2e4ab..05dc845 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -9,6 +9,11 @@ cargo-toml-patch-comments = [ https://github.com/zip-rs/zip2/issues/336.\ """, "patch out the nt-time features; rust-nt-time not yet packaged", + """\ + allow bzip2 0.6; see \ + https://github.com/zip-rs/zip2/commit/c8278990c40ddfbeb4a23877c1221792535d21b3, \ + released upstream in 4.3.0\ + """, ] doc-files.exclude = ["pull_request_template.md"] exclude-crate-files = [ diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index fa93a29..f0b39d1 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,5 +1,5 @@ --- zip-3.0.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-3.0.0/Cargo.toml 2025-05-16T11:17:25.429348+00:00 ++++ zip-3.0.0/Cargo.toml 2025-12-16T12:37:16.059987+00:00 @@ -244,6 +244,3 @@ [dev-dependencies.walkdir] version = "2.5" diff --git a/zip-fix-metadata.diff b/zip-fix-metadata.diff index 95bfdb7..c4e9c5b 100644 --- a/zip-fix-metadata.diff +++ b/zip-fix-metadata.diff @@ -1,5 +1,5 @@ --- zip-3.0.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-3.0.0/Cargo.toml 2025-05-16T11:17:25.430552+00:00 ++++ zip-3.0.0/Cargo.toml 2025-12-16T12:37:25.465467+00:00 @@ -97,7 +97,6 @@ ] jiff-02 = ["dep:jiff"] @@ -8,6 +8,15 @@ unreserved = [] xz = ["dep:xz2"] +@@ -125,7 +124,7 @@ + optional = true + + [dependencies.bzip2] +-version = "0.5.0" ++version = ">=0.5.0, <0.7.0" + optional = true + + [dependencies.chrono] @@ -151,7 +150,6 @@ [dependencies.getrandom] version = "0.3.1" From c92aec8fbb9d59389080f04feb8fc8fdabf63b9b Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 17 Dec 2025 10:33:48 +0000 Subject: [PATCH 26/28] Update to version 6.0.0 --- .gitignore | 2 + get_test_data.sh | 55 +++++++++++++-- rust-zip.spec | 103 ++++++++++++----------------- rust2rpm.toml | 33 ++++++--- sources | 4 +- zip-3.0.0-omitted-test-files.patch | 12 ---- zip-6.0.0-omitted-test-files.patch | 21 ++++++ zip-fix-metadata-auto.diff | 6 +- zip-fix-metadata.diff | 55 +++++++++------ 9 files changed, 179 insertions(+), 112 deletions(-) delete mode 100644 zip-3.0.0-omitted-test-files.patch create mode 100644 zip-6.0.0-omitted-test-files.patch diff --git a/.gitignore b/.gitignore index ace15fb..145e028 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,5 @@ /zip2-2.6.1-filtered.tar.gz /zip-3.0.0.crate /zip2-3.0.0-filtered.tar.gz +/zip-6.0.0.crate +/zip2-6.0.0-filtered.tar.gz diff --git a/get_test_data.sh b/get_test_data.sh index c853d63..ab00a90 100755 --- a/get_test_data.sh +++ b/get_test_data.sh @@ -21,6 +21,12 @@ FORGEURL='https://github.com/zip-rs/zip2' # - lin-ub_iwd-v11.zip: # LICENSE.lin-ub_iwd-v11.zip.txt clearly shows that this is at *best* not # under a license acceptable in Fedora. +# - omni.ja: +# This is a Firefox application resource bundle, +# https://udn.realityripple.com/docs/Mozilla/About_omni.ja_(formerly_omni.jar). +# It is very likely that everything in it is properly licensed for Fedora, +# but it is complex to audit, and we would rather not do all that work to +# confirm it’s OK when the alternative is just disabling a single test. # - pandoc_soft_links.zip: # Contains a copy of pandoc 3.2 compiled for aarch64: pandoc itself is # open-source, but who can say what was linked into it? The complete list of @@ -28,27 +34,67 @@ FORGEURL='https://github.com/zip-rs/zip2' OK_FILES="$(grep -vE '^(#|$)' <= 24 @@ -102,18 +112,6 @@ use the "_deflate-any" feature of the "%{crate}" crate. %files -n %{name}+_deflate-any-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+aes-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+aes-devel %{_description} - -This package contains library source intended for building other packages which -use the "aes" feature of the "%{crate}" crate. - -%files -n %{name}+aes-devel -%ghost %{crate_instdir}/Cargo.toml - %package -n %{name}+aes-crypto-devel Summary: %{summary} BuildArch: noarch @@ -126,6 +124,18 @@ use the "aes-crypto" feature of the "%{crate}" crate. %files -n %{name}+aes-crypto-devel %ghost %{crate_instdir}/Cargo.toml +%package -n %{name}+bitstream-io-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+bitstream-io-devel %{_description} + +This package contains library source intended for building other packages which +use the "bitstream-io" feature of the "%{crate}" crate. + +%files -n %{name}+bitstream-io-devel +%ghost %{crate_instdir}/Cargo.toml + %package -n %{name}+bzip2-devel Summary: %{summary} BuildArch: noarch @@ -150,18 +160,6 @@ use the "chrono" feature of the "%{crate}" crate. %files -n %{name}+chrono-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+constant_time_eq-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+constant_time_eq-devel %{_description} - -This package contains library source intended for building other packages which -use the "constant_time_eq" feature of the "%{crate}" crate. - -%files -n %{name}+constant_time_eq-devel -%ghost %{crate_instdir}/Cargo.toml - %package -n %{name}+deflate-devel Summary: %{summary} BuildArch: noarch @@ -270,6 +268,18 @@ use the "jiff-02" feature of the "%{crate}" crate. %files -n %{name}+jiff-02-devel %ghost %{crate_instdir}/Cargo.toml +%package -n %{name}+legacy-zip-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+legacy-zip-devel %{_description} + +This package contains library source intended for building other packages which +use the "legacy-zip" feature of the "%{crate}" crate. + +%files -n %{name}+legacy-zip-devel +%ghost %{crate_instdir}/Cargo.toml + %package -n %{name}+lzma-devel Summary: %{summary} BuildArch: noarch @@ -282,18 +292,6 @@ use the "lzma" feature of the "%{crate}" crate. %files -n %{name}+lzma-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+lzma-rs-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+lzma-rs-devel %{_description} - -This package contains library source intended for building other packages which -use the "lzma-rs" feature of the "%{crate}" crate. - -%files -n %{name}+lzma-rs-devel -%ghost %{crate_instdir}/Cargo.toml - %package -n %{name}+pbkdf2-devel Summary: %{summary} BuildArch: noarch @@ -366,18 +364,6 @@ use the "zeroize" feature of the "%{crate}" crate. %files -n %{name}+zeroize-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+zopfli-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+zopfli-devel %{_description} - -This package contains library source intended for building other packages which -use the "zopfli" feature of the "%{crate}" crate. - -%files -n %{name}+zopfli-devel -%ghost %{crate_instdir}/Cargo.toml - %package -n %{name}+zstd-devel Summary: %{summary} BuildArch: noarch @@ -407,7 +393,6 @@ use the "zstd" feature of the "%{crate}" crate. %check # Extract test data (only) from the GitHub archive tar -xzvf '%{SOURCE10}' --strip-components=1 'zip2-%{version}/tests/data/' -cp -vp '%{SOURCE11}' tests/data/ %cargo_test -a %endif diff --git a/rust2rpm.toml b/rust2rpm.toml index 05dc845..bba509c 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -2,17 +2,31 @@ cargo-toml-patch-comments = [ "drop unused benchmark-only / example-only dev-dependencies", """\ - Remove the wasm_js feature from the getrandom dependency for the getrandom \ - feature, and from the getrandom dev-dependency. Our rust-getrandom does not \ - provide this feature; see also “Unconditional use of getrandom’s wasm_js \ - feature is counter to upstream guidance,” \ - https://github.com/zip-rs/zip2/issues/336.\ + Remove the wasm_js feature from the getrandom dev-dependency. Our \ + rust-getrandom does not provide this feature; see also “Unconditional use of \ + getrandom’s wasm_js feature is counter to upstream guidance,” \ + https://github.com/zip-rs/zip2/issues/336. Upstream fixed the issue for the \ + dependency since 4.3.0, but not yet for the dev-dependency.\ """, "patch out the nt-time features; rust-nt-time not yet packaged", """\ - allow bzip2 0.6; see \ - https://github.com/zip-rs/zip2/commit/c8278990c40ddfbeb4a23877c1221792535d21b3, \ - released upstream in 4.3.0\ + deps: Bump lzma-rust2 to v0.15: \ + https://github.com/zip-rs/zip2/commit/d6d106fea2844793a8c80d27192b52694fcc57ca\ + """, + """\ + Patch out ppmd support, even though it is in the default features. While \ + the README.md for the ppmd-rust crate says “The code in this crate is in the \ + public domain as the original code by their authors,” Cargo.toml lists the \ + license as CC0-1.0, which is not precisely equivalent to the public-domain \ + declaration in the README and is not-allowed for code in Fedora.\ + """, + """\ + Remove lzma-static and xz-static features, which were supposed to be \ + removed in this release \ + (https://github.com/zip-rs/zip2/commit/af0f3349dae5640a0b756ea065c95af8a1a0e2a5), \ + but apparently were not due to \ + https://github.com/release-plz/release-plz/issues/2446 causing the previous \ + commit to be published.\ """, ] doc-files.exclude = ["pull_request_template.md"] @@ -42,7 +56,7 @@ comments = [ [[package.extra-patches]] number = 10 -file = "zip-3.0.0-omitted-test-files.patch" +file = "zip-6.0.0-omitted-test-files.patch" comments = [ """\ Downstream-only: patch out tests that would need omitted test files to \ @@ -57,6 +71,5 @@ enable-all = true check.pre = [ "# Extract test data (only) from the GitHub archive", "tar -xzvf '%{SOURCE10}' --strip-components=1 'zip2-%{version}/tests/data/'", - "cp -vp '%{SOURCE11}' tests/data/", ] diff --git a/sources b/sources index 8fa925c..f0b1d24 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zip-3.0.0.crate) = 64e0952ab5232a4c36e0f7c019fefd382f0373d2e7bbcdbe026bad522e14d9e483aa75793e9f592371497e068ba416a6939ef242223ed387c4d077a3ca044bc5 -SHA512 (zip2-3.0.0-filtered.tar.gz) = 8eb13dae727299566790ba067ebd85686fe62f4474cdfa8ac4d18c39d56c5fd258aba0d2f3babae1c6378f17d2e620c35dbb9e4afdc636fd45bf1b2924c6058d +SHA512 (zip-6.0.0.crate) = 0fbcc6ef6580df7db0d98f677bb5097a7c420646d1eec44b89714a7c9c7f54e4abe6489192f85e1debccfa241e3cbed2ef0a7eab3f0864b7f008527ace8e0996 +SHA512 (zip2-6.0.0-filtered.tar.gz) = 31db89194ac1512a8afe14f817aed588666853001a9c8bac2d64f93e2b818cd2ff1b4b784bb149febdfe5fd63f0b089bf8dcca04c36b2810c41e285ddb5a684a diff --git a/zip-3.0.0-omitted-test-files.patch b/zip-3.0.0-omitted-test-files.patch deleted file mode 100644 index 876a903..0000000 --- a/zip-3.0.0-omitted-test-files.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur zip-3.0.0-original/src/read.rs zip-3.0.0/src/read.rs ---- zip-3.0.0-original/src/read.rs 2006-07-23 21:21:28.000000000 -0400 -+++ zip-3.0.0/src/read.rs 2025-05-16 07:16:07.587241056 -0400 -@@ -2170,6 +2170,8 @@ - - #[test] - #[cfg(feature = "deflate-flate2")] -+ // Downstream patch: we do not include the test file needed for this test. -+ #[cfg(any())] - fn test_utf8_extra_field() { - let mut v = Vec::new(); - v.extend_from_slice(include_bytes!("../tests/data/chinese.zip")); diff --git a/zip-6.0.0-omitted-test-files.patch b/zip-6.0.0-omitted-test-files.patch new file mode 100644 index 0000000..9bc23c1 --- /dev/null +++ b/zip-6.0.0-omitted-test-files.patch @@ -0,0 +1,21 @@ +diff -Naur zip-6.0.0-original/src/read.rs zip-6.0.0/src/read.rs +--- zip-6.0.0-original/src/read.rs 2006-07-24 02:21:28.000000000 +0100 ++++ zip-6.0.0/src/read.rs 2025-12-17 11:48:28.449459541 +0000 +@@ -2316,6 +2316,8 @@ + + #[test] + #[cfg(feature = "deflate-flate2")] ++ // Downstream patch: we do not include the test file needed for this test. ++ #[cfg(any())] + fn test_utf8_extra_field() { + let mut reader = + ZipArchive::new(Cursor::new(include_bytes!("../tests/data/chinese.zip"))).unwrap(); +@@ -2399,6 +2401,8 @@ + } + + #[test] ++ // Downstream patch: we do not include the test file needed for this test. ++ #[cfg(any())] + fn test_central_directory_not_at_end() -> ZipResult<()> { + let mut reader = ZipArchive::new(Cursor::new(include_bytes!("../tests/data/omni.ja")))?; + let mut file = reader.by_name("chrome.manifest")?; diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index f0b39d1..580f862 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,6 +1,6 @@ ---- zip-3.0.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-3.0.0/Cargo.toml 2025-12-16T12:37:16.059987+00:00 -@@ -244,6 +244,3 @@ +--- zip-6.0.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-6.0.0/Cargo.toml 2025-12-18T14:11:57.288488+00:00 +@@ -256,6 +256,3 @@ [dev-dependencies.walkdir] version = "2.5" diff --git a/zip-fix-metadata.diff b/zip-fix-metadata.diff index c4e9c5b..f58a6c6 100644 --- a/zip-fix-metadata.diff +++ b/zip-fix-metadata.diff @@ -1,31 +1,36 @@ ---- zip-3.0.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-3.0.0/Cargo.toml 2025-12-16T12:37:25.465467+00:00 -@@ -97,7 +97,6 @@ - ] +--- zip-6.0.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-6.0.0/Cargo.toml 2025-12-18T14:12:06.721249+00:00 +@@ -71,7 +71,6 @@ + "deflate64", + "deflate", + "lzma", +- "ppmd", + "time", + "zstd", + "xz", +@@ -99,12 +98,8 @@ jiff-02 = ["dep:jiff"] - lzma = ["lzma-rs/stream"] + legacy-zip = ["bitstream-io"] + lzma = ["dep:lzma-rust2"] +-lzma-static = ["lzma"] -nt-time = ["dep:nt-time"] +-ppmd = ["dep:ppmd-rust"] unreserved = [] - xz = ["dep:xz2"] + xz = ["dep:lzma-rust2"] +-xz-static = ["lzma"] -@@ -125,7 +124,7 @@ + [lib] + name = "zip" +@@ -175,7 +170,7 @@ optional = true - [dependencies.bzip2] --version = "0.5.0" -+version = ">=0.5.0, <0.7.0" - optional = true - - [dependencies.chrono] -@@ -151,7 +150,6 @@ - [dependencies.getrandom] - version = "0.3.1" + [dependencies.lzma-rust2] +-version = "0.13" ++version = "0.15" features = [ -- "wasm_js", "std", - ] - optional = true -@@ -176,11 +174,6 @@ + "encoder", +@@ -188,17 +183,8 @@ [dependencies.memchr] version = "2.7" @@ -36,8 +41,14 @@ - [dependencies.pbkdf2] version = "0.12" +-optional = true +- +-[dependencies.ppmd-rust] +-version = "1.2" optional = true -@@ -213,20 +206,9 @@ + + [dependencies.sha1] +@@ -225,20 +211,9 @@ optional = true default-features = false @@ -58,7 +69,7 @@ "std", ] -@@ -241,6 +223,3 @@ +@@ -253,6 +228,3 @@ ] default-features = false From 5f5c8daa03444ac2d9c277b36a82f209c306bcfe Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 8 Jan 2026 21:08:52 +0000 Subject: [PATCH 27/28] Update to version 7.0.0; Fixes RHBZ#2367905 --- .gitignore | 2 + rust-zip.spec | 91 +++++++++----------------------------- rust2rpm.toml | 21 ++++----- sources | 4 +- zip-fix-metadata-auto.diff | 6 +-- zip-fix-metadata.diff | 43 ++++++++++-------- 6 files changed, 61 insertions(+), 106 deletions(-) diff --git a/.gitignore b/.gitignore index 145e028..66c40c1 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,5 @@ /zip2-3.0.0-filtered.tar.gz /zip-6.0.0.crate /zip2-6.0.0-filtered.tar.gz +/zip-7.0.0.crate +/zip2-7.0.0-filtered.tar.gz diff --git a/rust-zip.spec b/rust-zip.spec index 465ffea..efe3103 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -5,7 +5,7 @@ %global crate zip Name: rust-zip -Version: 6.0.0 +Version: 7.0.0 Release: %autorelease Summary: Library to support the reading and writing of zip files @@ -23,26 +23,23 @@ Source11: get_test_data.sh # Automatically generated patch to strip dependencies and normalize metadata Patch: zip-fix-metadata-auto.diff # Manually created patch for downstream crate metadata changes -# * drop unused benchmark-only / example-only dev-dependencies +# * Drop unused benchmark-only / example-only dev-dependencies # * Remove the wasm_js feature from the getrandom dev-dependency. Our # rust-getrandom does not provide this feature; see also “Unconditional use of # getrandom’s wasm_js feature is counter to upstream guidance,” # https://github.com/zip-rs/zip2/issues/336. Upstream fixed the issue for the # dependency since 4.3.0, but not yet for the dev-dependency. -# * patch out the nt-time features; rust-nt-time not yet packaged -# * deps: Bump lzma-rust2 to v0.15: -# https://github.com/zip-rs/zip2/commit/d6d106fea2844793a8c80d27192b52694fcc57ca +# * Patch out the nt-time features; rust-nt-time not yet packaged # * Patch out ppmd support, even though it is in the default features. While the # README.md for the ppmd-rust crate says “The code in this crate is in the # public domain as the original code by their authors,” Cargo.toml lists the # license as CC0-1.0, which is not precisely equivalent to the public-domain # declaration in the README and is not-allowed for code in Fedora. -# * Remove lzma-static and xz-static features, which were supposed to be removed -# in this release -# (https://github.com/zip-rs/zip2/commit/af0f3349dae5640a0b756ea065c95af8a1a0e2a5), -# but apparently were not due to -# https://github.com/release-plz/release-plz/issues/2446 causing the previous -# commit to be published. +# * Patch out the deflate-flate2-zlib-ng-compat feature, which requires +# flate2/zlib-ng-compat, not packaged. +# * Unpin generic-array; see https://github.com/zip-rs/zip2/pull/458 for the +# upstream rationale, but we cannot use an old version and are not so +# concerned about deprecation warnings anyway. Patch: zip-fix-metadata.diff # * Downstream-only: patch out tests that would need omitted test files to # compile @@ -196,6 +193,18 @@ use the "deflate-flate2-zlib" feature of the "%{crate}" crate. %files -n %{name}+deflate-flate2-zlib-devel %ghost %{crate_instdir}/Cargo.toml +%package -n %{name}+deflate-flate2-zlib-ng-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+deflate-flate2-zlib-ng-devel %{_description} + +This package contains library source intended for building other packages which +use the "deflate-flate2-zlib-ng" feature of the "%{crate}" crate. + +%files -n %{name}+deflate-flate2-zlib-ng-devel +%ghost %{crate_instdir}/Cargo.toml + %package -n %{name}+deflate-flate2-zlib-rs-devel Summary: %{summary} BuildArch: noarch @@ -232,30 +241,6 @@ use the "deflate64" feature of the "%{crate}" crate. %files -n %{name}+deflate64-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+getrandom-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+getrandom-devel %{_description} - -This package contains library source intended for building other packages which -use the "getrandom" feature of the "%{crate}" crate. - -%files -n %{name}+getrandom-devel -%ghost %{crate_instdir}/Cargo.toml - -%package -n %{name}+hmac-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+hmac-devel %{_description} - -This package contains library source intended for building other packages which -use the "hmac" feature of the "%{crate}" crate. - -%files -n %{name}+hmac-devel -%ghost %{crate_instdir}/Cargo.toml - %package -n %{name}+jiff-02-devel Summary: %{summary} BuildArch: noarch @@ -292,30 +277,6 @@ use the "lzma" feature of the "%{crate}" crate. %files -n %{name}+lzma-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+pbkdf2-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+pbkdf2-devel %{_description} - -This package contains library source intended for building other packages which -use the "pbkdf2" feature of the "%{crate}" crate. - -%files -n %{name}+pbkdf2-devel -%ghost %{crate_instdir}/Cargo.toml - -%package -n %{name}+sha1-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+sha1-devel %{_description} - -This package contains library source intended for building other packages which -use the "sha1" feature of the "%{crate}" crate. - -%files -n %{name}+sha1-devel -%ghost %{crate_instdir}/Cargo.toml - %package -n %{name}+time-devel Summary: %{summary} BuildArch: noarch @@ -352,18 +313,6 @@ use the "xz" feature of the "%{crate}" crate. %files -n %{name}+xz-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+zeroize-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+zeroize-devel %{_description} - -This package contains library source intended for building other packages which -use the "zeroize" feature of the "%{crate}" crate. - -%files -n %{name}+zeroize-devel -%ghost %{crate_instdir}/Cargo.toml - %package -n %{name}+zstd-devel Summary: %{summary} BuildArch: noarch diff --git a/rust2rpm.toml b/rust2rpm.toml index bba509c..d4dd7a0 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -1,6 +1,6 @@ [package] cargo-toml-patch-comments = [ - "drop unused benchmark-only / example-only dev-dependencies", + "Drop unused benchmark-only / example-only dev-dependencies", """\ Remove the wasm_js feature from the getrandom dev-dependency. Our \ rust-getrandom does not provide this feature; see also “Unconditional use of \ @@ -8,11 +8,7 @@ cargo-toml-patch-comments = [ https://github.com/zip-rs/zip2/issues/336. Upstream fixed the issue for the \ dependency since 4.3.0, but not yet for the dev-dependency.\ """, - "patch out the nt-time features; rust-nt-time not yet packaged", - """\ - deps: Bump lzma-rust2 to v0.15: \ - https://github.com/zip-rs/zip2/commit/d6d106fea2844793a8c80d27192b52694fcc57ca\ - """, + "Patch out the nt-time features; rust-nt-time not yet packaged", """\ Patch out ppmd support, even though it is in the default features. While \ the README.md for the ppmd-rust crate says “The code in this crate is in the \ @@ -21,12 +17,13 @@ cargo-toml-patch-comments = [ declaration in the README and is not-allowed for code in Fedora.\ """, """\ - Remove lzma-static and xz-static features, which were supposed to be \ - removed in this release \ - (https://github.com/zip-rs/zip2/commit/af0f3349dae5640a0b756ea065c95af8a1a0e2a5), \ - but apparently were not due to \ - https://github.com/release-plz/release-plz/issues/2446 causing the previous \ - commit to be published.\ + Patch out the deflate-flate2-zlib-ng-compat feature, which requires \ + flate2/zlib-ng-compat, not packaged.\ + """, + """\ + Unpin generic-array; see https://github.com/zip-rs/zip2/pull/458 for the \ + upstream rationale, but we cannot use an old version and are not so \ + concerned about deprecation warnings anyway.\ """, ] doc-files.exclude = ["pull_request_template.md"] diff --git a/sources b/sources index f0b1d24..ce5d3d4 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zip-6.0.0.crate) = 0fbcc6ef6580df7db0d98f677bb5097a7c420646d1eec44b89714a7c9c7f54e4abe6489192f85e1debccfa241e3cbed2ef0a7eab3f0864b7f008527ace8e0996 -SHA512 (zip2-6.0.0-filtered.tar.gz) = 31db89194ac1512a8afe14f817aed588666853001a9c8bac2d64f93e2b818cd2ff1b4b784bb149febdfe5fd63f0b089bf8dcca04c36b2810c41e285ddb5a684a +SHA512 (zip-7.0.0.crate) = ef79949f6acb5e6d46f0458fb08fc465baab032e03b66af517c7db0812a33671cf12124e8a279521e072b83ae9d6ad74ca69a12541079e8b7d6db242e612f260 +SHA512 (zip2-7.0.0-filtered.tar.gz) = 68e02788edb45009430c808e79f89e0141082c883f13d653676152402ef54056af602721b388e4c0c186dcbc0c8d7699f476ecb7339b932cd9c48e6a669e65ad diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index 580f862..46c64ed 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,6 +1,6 @@ ---- zip-6.0.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-6.0.0/Cargo.toml 2025-12-18T14:11:57.288488+00:00 -@@ -256,6 +256,3 @@ +--- zip-7.0.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-7.0.0/Cargo.toml 2026-01-08T21:12:30.103500+00:00 +@@ -267,6 +267,3 @@ [dev-dependencies.walkdir] version = "2.5" diff --git a/zip-fix-metadata.diff b/zip-fix-metadata.diff index f58a6c6..de084f1 100644 --- a/zip-fix-metadata.diff +++ b/zip-fix-metadata.diff @@ -1,6 +1,6 @@ ---- zip-6.0.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-6.0.0/Cargo.toml 2025-12-18T14:12:06.721249+00:00 -@@ -71,7 +71,6 @@ +--- zip-7.0.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zip-7.0.0/Cargo.toml 2026-01-08T21:12:43.954211+00:00 +@@ -72,7 +72,6 @@ "deflate64", "deflate", "lzma", @@ -8,29 +8,36 @@ "time", "zstd", "xz", -@@ -99,12 +98,8 @@ +@@ -93,10 +92,6 @@ + "deflate-flate2", + "flate2/zlib-ng", + ] +-deflate-flate2-zlib-ng-compat = [ +- "deflate-flate2", +- "flate2/zlib-ng-compat", +-] + deflate-flate2-zlib-rs = [ + "deflate-flate2", + "flate2/zlib-rs", +@@ -108,8 +103,6 @@ jiff-02 = ["dep:jiff"] legacy-zip = ["bitstream-io"] lzma = ["dep:lzma-rust2"] --lzma-static = ["lzma"] -nt-time = ["dep:nt-time"] -ppmd = ["dep:ppmd-rust"] unreserved = [] xz = ["dep:lzma-rust2"] --xz-static = ["lzma"] - [lib] - name = "zip" -@@ -175,7 +170,7 @@ +@@ -165,7 +158,7 @@ + default-features = false + + [dependencies.generic-array] +-version = "=0.14.7" ++version = "0.14.7" optional = true - [dependencies.lzma-rust2] --version = "0.13" -+version = "0.15" - features = [ - "std", - "encoder", -@@ -188,17 +183,8 @@ + [dependencies.getrandom] +@@ -199,17 +192,8 @@ [dependencies.memchr] version = "2.7" @@ -48,7 +55,7 @@ optional = true [dependencies.sha1] -@@ -225,20 +211,9 @@ +@@ -236,20 +220,9 @@ optional = true default-features = false @@ -69,7 +76,7 @@ "std", ] -@@ -253,6 +228,3 @@ +@@ -264,6 +237,3 @@ ] default-features = false From 2ddbb8fece2f44c2ae399d395629c1b5ab09d2fb Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 9 Jan 2026 22:12:51 +0000 Subject: [PATCH 28/28] Update constant_time_eq from 0.3.1 to 0.4.2 --- rust-zip.spec | 2 ++ rust2rpm.toml | 4 ++++ zip-fix-metadata-auto.diff | 2 +- zip-fix-metadata.diff | 11 ++++++++++- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/rust-zip.spec b/rust-zip.spec index efe3103..75c22f5 100644 --- a/rust-zip.spec +++ b/rust-zip.spec @@ -40,6 +40,8 @@ Patch: zip-fix-metadata-auto.diff # * Unpin generic-array; see https://github.com/zip-rs/zip2/pull/458 for the # upstream rationale, but we cannot use an old version and are not so # concerned about deprecation warnings anyway. +# * Update constant_time_eq from 0.3.1 to 0.4.2. Downstream-only for MSRV +# reasons. Patch: zip-fix-metadata.diff # * Downstream-only: patch out tests that would need omitted test files to # compile diff --git a/rust2rpm.toml b/rust2rpm.toml index d4dd7a0..c25ed64 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -25,6 +25,10 @@ cargo-toml-patch-comments = [ upstream rationale, but we cannot use an old version and are not so \ concerned about deprecation warnings anyway.\ """, + """\ + Update constant_time_eq from 0.3.1 to 0.4.2. Downstream-only for MSRV \ + reasons.\ + """, ] doc-files.exclude = ["pull_request_template.md"] exclude-crate-files = [ diff --git a/zip-fix-metadata-auto.diff b/zip-fix-metadata-auto.diff index 46c64ed..d1d32f2 100644 --- a/zip-fix-metadata-auto.diff +++ b/zip-fix-metadata-auto.diff @@ -1,5 +1,5 @@ --- zip-7.0.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-7.0.0/Cargo.toml 2026-01-08T21:12:30.103500+00:00 ++++ zip-7.0.0/Cargo.toml 2026-01-09T22:11:25.991905+00:00 @@ -267,6 +267,3 @@ [dev-dependencies.walkdir] version = "2.5" diff --git a/zip-fix-metadata.diff b/zip-fix-metadata.diff index de084f1..d869273 100644 --- a/zip-fix-metadata.diff +++ b/zip-fix-metadata.diff @@ -1,5 +1,5 @@ --- zip-7.0.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zip-7.0.0/Cargo.toml 2026-01-08T21:12:43.954211+00:00 ++++ zip-7.0.0/Cargo.toml 2026-01-09T22:11:31.620816+00:00 @@ -72,7 +72,6 @@ "deflate64", "deflate", @@ -28,6 +28,15 @@ unreserved = [] xz = ["dep:lzma-rust2"] +@@ -149,7 +142,7 @@ + optional = true + + [dependencies.constant_time_eq] +-version = "0.3.1" ++version = "0.4.2" + optional = true + + [dependencies.crc32fast] @@ -165,7 +158,7 @@ default-features = false