Compare commits

...

No commits in common. "c8-stream-201902" and "c9-beta-stream-202201" have entirely different histories.

7 changed files with 138 additions and 54 deletions

View File

@ -1 +1 @@
df2eaf0fe313ac68f0ace6e460fa56633051472b SOURCES/commons-compress-1.19-src.tar.gz 12ee2d916040f1985b1389c62cc3e8071911cf31 SOURCES/commons-compress-1.21-src.tar.gz

1
.gitignore vendored
View File

@ -1 +0,0 @@
SOURCES/commons-compress-1.19-src.tar.gz

View File

@ -8,7 +8,7 @@ Subject: [PATCH 1/3] Remove Brotli compressor
1 file changed, 1 insertion(+), 6 deletions(-) 1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java diff --git a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
index d730b9d..ab178a9 100644 index db0d305..0f1394f 100644
--- a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java --- a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
+++ b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java +++ b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
@@ -31,8 +31,6 @@ import java.util.Set; @@ -31,8 +31,6 @@ import java.util.Set;
@ -20,7 +20,7 @@ index d730b9d..ab178a9 100644
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream; import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream; import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream;
import org.apache.commons.compress.compressors.deflate.DeflateCompressorInputStream; import org.apache.commons.compress.compressors.deflate.DeflateCompressorInputStream;
@@ -586,10 +584,7 @@ public class CompressorStreamFactory implements CompressorStreamProvider { @@ -579,10 +577,7 @@ public class CompressorStreamFactory implements CompressorStreamProvider {
} }
if (BROTLI.equalsIgnoreCase(name)) { if (BROTLI.equalsIgnoreCase(name)) {

View File

@ -8,7 +8,7 @@ Subject: [PATCH 2/3] Remove ZSTD compressor
1 file changed, 2 insertions(+), 12 deletions(-) 1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java diff --git a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
index ab178a9..3817704 100644 index 0f1394f..eee7c31 100644
--- a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java --- a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
+++ b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java +++ b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
@@ -54,9 +54,6 @@ import org.apache.commons.compress.compressors.xz.XZCompressorInputStream; @@ -54,9 +54,6 @@ import org.apache.commons.compress.compressors.xz.XZCompressorInputStream;
@ -21,7 +21,7 @@ index ab178a9..3817704 100644
import org.apache.commons.compress.utils.IOUtils; import org.apache.commons.compress.utils.IOUtils;
import org.apache.commons.compress.utils.Lists; import org.apache.commons.compress.utils.Lists;
import org.apache.commons.compress.utils.ServiceLoaderIterator; import org.apache.commons.compress.utils.ServiceLoaderIterator;
@@ -516,10 +513,6 @@ public class CompressorStreamFactory implements CompressorStreamProvider { @@ -509,10 +506,6 @@ public class CompressorStreamFactory implements CompressorStreamProvider {
return LZ4_FRAMED; return LZ4_FRAMED;
} }
@ -32,7 +32,7 @@ index ab178a9..3817704 100644
throw new CompressorException("No Compressor found for the stream signature."); throw new CompressorException("No Compressor found for the stream signature.");
} }
/** /**
@@ -595,10 +588,7 @@ public class CompressorStreamFactory implements CompressorStreamProvider { @@ -588,10 +581,7 @@ public class CompressorStreamFactory implements CompressorStreamProvider {
} }
if (ZSTANDARD.equalsIgnoreCase(name)) { if (ZSTANDARD.equalsIgnoreCase(name)) {
@ -44,7 +44,7 @@ index ab178a9..3817704 100644
} }
if (LZMA.equalsIgnoreCase(name)) { if (LZMA.equalsIgnoreCase(name)) {
@@ -714,7 +704,7 @@ public class CompressorStreamFactory implements CompressorStreamProvider { @@ -707,7 +697,7 @@ public class CompressorStreamFactory implements CompressorStreamProvider {
} }
if (ZSTANDARD.equalsIgnoreCase(name)) { if (ZSTANDARD.equalsIgnoreCase(name)) {

View File

@ -1,32 +0,0 @@
From 4dd332d8f82d3a5f0ac6654d2c1733e44da6ddbd Mon Sep 17 00:00:00 2001
From: Mat Booth <mat.booth@redhat.com>
Date: Thu, 7 Feb 2019 14:57:25 +0000
Subject: [PATCH 3/3] Avoid use of internal Mockito API
---
.../compress/utils/FixedLengthBlockOutputStreamTest.java | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/test/java/org/apache/commons/compress/utils/FixedLengthBlockOutputStreamTest.java b/src/test/java/org/apache/commons/compress/utils/FixedLengthBlockOutputStreamTest.java
index cfda61b..e94ccee 100644
--- a/src/test/java/org/apache/commons/compress/utils/FixedLengthBlockOutputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/utils/FixedLengthBlockOutputStreamTest.java
@@ -39,7 +39,6 @@ import java.nio.file.Path;
import java.util.concurrent.atomic.AtomicBoolean;
import org.hamcrest.core.IsInstanceOf;
import org.junit.Test;
-import org.mockito.internal.matchers.GreaterOrEqual;
public class FixedLengthBlockOutputStreamTest {
@@ -294,7 +293,6 @@ public class FixedLengthBlockOutputStreamTest {
private static void assertContainsAtOffset(String msg, byte[] expected, int offset,
byte[] actual) {
- assertThat(actual.length, new GreaterOrEqual<>(offset + expected.length));
for (int i = 0; i < expected.length; i++) {
assertEquals(String.format("%s ([%d])", msg, i), expected[i], actual[i + offset]);
}
--
2.20.1

View File

@ -0,0 +1,54 @@
From 9937297a90b43a5e1238932eb8a07c44303056ed Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
Date: Fri, 6 Aug 2021 13:42:40 +0200
Subject: [PATCH] Remove Pack200 compressor
---
.../compress/compressors/CompressorStreamFactory.java | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
index eee7c31..de7da23 100644
--- a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
+++ b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
@@ -45,8 +45,6 @@ import org.apache.commons.compress.compressors.lz4.FramedLZ4CompressorOutputStre
import org.apache.commons.compress.compressors.lzma.LZMACompressorInputStream;
import org.apache.commons.compress.compressors.lzma.LZMACompressorOutputStream;
import org.apache.commons.compress.compressors.lzma.LZMAUtils;
-import org.apache.commons.compress.compressors.pack200.Pack200CompressorInputStream;
-import org.apache.commons.compress.compressors.pack200.Pack200CompressorOutputStream;
import org.apache.commons.compress.compressors.snappy.FramedSnappyCompressorInputStream;
import org.apache.commons.compress.compressors.snappy.FramedSnappyCompressorOutputStream;
import org.apache.commons.compress.compressors.snappy.SnappyCompressorInputStream;
@@ -478,10 +476,6 @@ public class CompressorStreamFactory implements CompressorStreamProvider {
return GZIP;
}
- if (Pack200CompressorInputStream.matches(signature, signatureLength)) {
- return PACK200;
- }
-
if (FramedSnappyCompressorInputStream.matches(signature, signatureLength)) {
return SNAPPY_FRAMED;
}
@@ -592,7 +586,7 @@ public class CompressorStreamFactory implements CompressorStreamProvider {
}
if (PACK200.equalsIgnoreCase(name)) {
- return new Pack200CompressorInputStream(in);
+ throw new CompressorException("Pack200 compression is not available in this build.");
}
if (SNAPPY_RAW.equalsIgnoreCase(name)) {
@@ -673,7 +667,7 @@ public class CompressorStreamFactory implements CompressorStreamProvider {
}
if (PACK200.equalsIgnoreCase(name)) {
- return new Pack200CompressorOutputStream(out);
+ throw new CompressorException("Pack200 compression is not available in this build.");
}
if (LZMA.equalsIgnoreCase(name)) {
--
2.31.1

View File

@ -1,25 +1,33 @@
%bcond_with bootstrap
Name: apache-commons-compress Name: apache-commons-compress
Version: 1.19 Version: 1.21
Release: 2%{?dist} Release: 4%{?dist}
Summary: Java API for working with compressed files and archivers Summary: Java API for working with compressed files and archivers
License: ASL 2.0 License: ASL 2.0
URL: http://commons.apache.org/proper/commons-compress/ URL: https://commons.apache.org/proper/commons-compress/
BuildArch: noarch BuildArch: noarch
ExclusiveArch: %{java_arches} noarch
Source0: http://archive.apache.org/dist/commons/compress/source/commons-compress-%{version}-src.tar.gz Source0: https://archive.apache.org/dist/commons/compress/source/commons-compress-%{version}-src.tar.gz
Patch0: 0001-Remove-Brotli-compressor.patch Patch0: 0001-Remove-Brotli-compressor.patch
Patch1: 0002-Remove-ZSTD-compressor.patch Patch1: 0002-Remove-ZSTD-compressor.patch
Patch2: 0003-Avoid-use-of-internal-Mockito-API.patch Patch2: 0003-Remove-Pack200-compressor.patch
%if %{with bootstrap}
BuildRequires: javapackages-bootstrap
%else
BuildRequires: maven-local BuildRequires: maven-local
BuildRequires: mvn(junit:junit) BuildRequires: mvn(junit:junit)
BuildRequires: mvn(org.apache.commons:commons-parent:pom:) BuildRequires: mvn(org.apache.commons:commons-parent:pom:)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin)
BuildRequires: mvn(org.hamcrest:hamcrest)
BuildRequires: mvn(org.mockito:mockito-core) BuildRequires: mvn(org.mockito:mockito-core)
BuildRequires: mvn(org.osgi:org.osgi.core) BuildRequires: mvn(org.osgi:org.osgi.core)
BuildRequires: mvn(org.tukaani:xz) BuildRequires: mvn(org.tukaani:xz)
%endif
%description %description
The Apache Commons Compress library defines an API for working with The Apache Commons Compress library defines an API for working with
@ -47,8 +55,15 @@ rm -r src/{main,test}/java/org/apache/commons/compress/compressors/brotli
rm -r src/{main,test}/java/org/apache/commons/compress/compressors/zstandard rm -r src/{main,test}/java/org/apache/commons/compress/compressors/zstandard
rm src/test/java/org/apache/commons/compress/compressors/DetectCompressorTestCase.java rm src/test/java/org/apache/commons/compress/compressors/DetectCompressorTestCase.java
# Avoid using internal Mockito APIs # Remove support for pack200 which depends on ancient asm:asm:3.2
%patch2 -p1 %patch2 -p1
%pom_remove_dep asm:asm
rm -r src/{main,test}/java/org/apache/commons/compress/harmony
rm -r src/main/java/org/apache/commons/compress/compressors/pack200
rm src/main/java/org/apache/commons/compress/java/util/jar/Pack200.java
rm src/test/java/org/apache/commons/compress/compressors/Pack200TestCase.java
rm -r src/test/java/org/apache/commons/compress/compressors/pack200
rm src/test/java/org/apache/commons/compress/java/util/jar/Pack200Test.java
# remove osgi tests, we don't have deps for them # remove osgi tests, we don't have deps for them
%pom_remove_dep org.ops4j.pax.exam:::test %pom_remove_dep org.ops4j.pax.exam:::test
@ -57,17 +72,13 @@ rm src/test/java/org/apache/commons/compress/compressors/DetectCompressorTestCas
%pom_remove_dep :slf4j-api::test %pom_remove_dep :slf4j-api::test
rm src/test/java/org/apache/commons/compress/OsgiITest.java rm src/test/java/org/apache/commons/compress/OsgiITest.java
# Remove test that requires powermock # Not packaged
%pom_remove_dep org.powermock: %pom_remove_dep com.github.marschall:memoryfilesystem
%pom_add_dep org.mockito:mockito-core::test rm src/test/java/org/apache/commons/compress/archivers/tar/TarMemoryFileSystemTest.java
rm src/test/java/org/apache/commons/compress/compressors/z/ZCompressorInputStreamTest.java
%build %build
%mvn_file : commons-compress %{name} %mvn_file : commons-compress %{name}
%mvn_alias : commons: %mvn_alias : commons:
%if 0%{?rhel} && 0%{?rhel} <= 7
export LC_ALL=en_US.UTF-8
%endif
%mvn_build -- -Dcommons.osgi.symbolicName=org.apache.commons.compress %mvn_build -- -Dcommons.osgi.symbolicName=org.apache.commons.compress
%install %install
@ -80,12 +91,64 @@ export LC_ALL=en_US.UTF-8
%doc LICENSE.txt NOTICE.txt %doc LICENSE.txt NOTICE.txt
%changelog %changelog
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.21-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Sat Feb 05 2022 Jiri Vanek <jvanek@redhat.com> - 1.21-3
- Rebuilt for java-17-openjdk as system jdk
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.21-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Aug 06 2021 Marian Koncek <mkoncek@redhat.com> - 1.21-1
- Update to upstream version 1.21
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.20-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Mon May 17 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.20-6
- Bootstrap build
- Non-bootstrap build
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.20-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.20-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Jul 16 2020 Mat Booth <mat.booth@redhat.com> - 1.20-3
- Ensure Java 8 level bytecode when built on Java 11
* Fri Jul 10 2020 Jiri Vanek <jvanek@redhat.com> - 1.20-2
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
* Wed Mar 04 2020 Marian Koncek <mkoncek@redhat.com> - 1.20-1
- Update to upstream version 1.20
* Mon Mar 02 2020 Fabio Valentini <decathorpe@gmail.com> - 1.20-1
- Update to version 1.20.
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.19-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Tue Nov 05 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.19-2 * Tue Nov 05 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.19-2
- Mass rebuild for javapackages-tools 201902 - Mass rebuild for javapackages-tools 201902
* Fri Oct 04 2019 Fabio Valentini <decathorpe@gmail.com> - 1.19-1
- Update to version 1.19.
* Wed Sep 18 2019 Fabio Valentini <decathorpe@gmail.com> - 1.18-7
- Migrate from the obsolete felix-osgi-core to osgi-core.
* Mon Sep 02 2019 Marian Koncek <mkoncek@redhat.com> - 1.19-1 * Mon Sep 02 2019 Marian Koncek <mkoncek@redhat.com> - 1.19-1
- Update to upstream version 1.19 - Update to upstream version 1.19
* Wed Aug 14 2019 Fabio Valentini <decathorpe@gmail.com> - 1.18-6
- Remove build-dependency on powermock
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.18-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri May 24 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.18-6 * Fri May 24 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.18-6
- Mass rebuild for javapackages-tools 201901 - Mass rebuild for javapackages-tools 201901
@ -103,7 +166,7 @@ export LC_ALL=en_US.UTF-8
* Fri Oct 05 2018 Marian Koncek <mkoncek@redhat.com> - 1.18-1 * Fri Oct 05 2018 Marian Koncek <mkoncek@redhat.com> - 1.18-1
- Update to upstream version 1.18 - Update to upstream version 1.18
- Resolves: CVE-2018-11771 - Resolves CVE-2018-11771
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.17-2 * Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.17-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild