Update to upstream version 1.21

This commit is contained in:
Marian Koncek 2021-08-06 15:09:23 +02:00
parent 52ad07d3af
commit f4ab0b6b80
7 changed files with 80 additions and 47 deletions

1
.gitignore vendored
View File

@ -24,3 +24,4 @@
/commons-compress-1.18-src.tar.gz
/commons-compress-1.19-src.tar.gz
/commons-compress-1.20-src.tar.gz
/commons-compress-1.21-src.tar.gz

View File

@ -8,7 +8,7 @@ Subject: [PATCH 1/3] Remove Brotli compressor
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
index d730b9d..ab178a9 100644
index db0d305..0f1394f 100644
--- a/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;
@ -20,7 +20,7 @@ index d730b9d..ab178a9 100644
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream;
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)) {

View File

@ -8,7 +8,7 @@ Subject: [PATCH 2/3] Remove ZSTD compressor
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
index ab178a9..3817704 100644
index 0f1394f..eee7c31 100644
--- a/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;
@ -21,7 +21,7 @@ index ab178a9..3817704 100644
import org.apache.commons.compress.utils.IOUtils;
import org.apache.commons.compress.utils.Lists;
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;
}
@ -32,7 +32,7 @@ index ab178a9..3817704 100644
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)) {
@ -44,7 +44,7 @@ index ab178a9..3817704 100644
}
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)) {

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,8 +1,8 @@
%bcond_with bootstrap
Name: apache-commons-compress
Version: 1.20
Release: 7%{?dist}
Version: 1.21
Release: 1%{?dist}
Summary: Java API for working with compressed files and archivers
License: ASL 2.0
URL: https://commons.apache.org/proper/commons-compress/
@ -12,7 +12,7 @@ Source0: https://archive.apache.org/dist/commons/compress/source/commons-
Patch0: 0001-Remove-Brotli-compressor.patch
Patch1: 0002-Remove-ZSTD-compressor.patch
Patch2: 0003-Avoid-use-of-internal-Mockito-API.patch
Patch2: 0003-Remove-Pack200-compressor.patch
BuildRequires: maven-local
%if %{with bootstrap}
@ -22,6 +22,7 @@ BuildRequires: mvn(junit:junit)
BuildRequires: mvn(org.apache.commons:commons-parent:pom:)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin)
BuildRequires: mvn(org.hamcrest:hamcrest)
BuildRequires: mvn(org.mockito:mockito-core)
BuildRequires: mvn(org.osgi:org.osgi.core)
BuildRequires: mvn(org.tukaani:xz)
@ -53,8 +54,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 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
%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
%pom_remove_dep org.ops4j.pax.exam:::test
@ -63,10 +71,9 @@ rm src/test/java/org/apache/commons/compress/compressors/DetectCompressorTestCas
%pom_remove_dep :slf4j-api::test
rm src/test/java/org/apache/commons/compress/OsgiITest.java
# Remove test that requires powermock
%pom_remove_dep org.powermock:
%pom_add_dep org.mockito:mockito-core::test
rm src/test/java/org/apache/commons/compress/compressors/z/ZCompressorInputStreamTest.java
# Not packaged
%pom_remove_dep com.github.marschall:memoryfilesystem
rm src/test/java/org/apache/commons/compress/archivers/tar/TarMemoryFileSystemTest.java
%build
%mvn_file : commons-compress %{name}
@ -83,6 +90,9 @@ rm src/test/java/org/apache/commons/compress/compressors/z/ZCompressorInputStrea
%doc LICENSE.txt NOTICE.txt
%changelog
* 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

View File

@ -1 +1 @@
SHA512 (commons-compress-1.20-src.tar.gz) = 1794bae69e00339d9e4d35b3276543ff6f9a0f1614ec9bd7c4ec8ff1bc86d08cd48e9dc3ec712b969cf8ccd61ef6054d0c6203d7cba0c28b22e6a3ecccd0c43e
SHA512 (commons-compress-1.21-src.tar.gz) = 8041371b491057435ca62390e70b30031e4d21e80c37d9cb922fdffa794b56aee3b5d60d8241e4db0cecc28c82dfdaafbe52b2175e26062da169fec8efbb17e1