You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by pe...@apache.org on 2020/12/10 03:16:35 UTC

[commons-compress] branch master updated (05a995e -> d98e849)

This is an automated email from the ASF dual-hosted git repository.

peterlee pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git.


    from 05a995e  do not use wildcard imports
     new 75a16c2  COMPRESS-559: Extract sparsefile-0.1 also on Linux
     new d98e849  COMPRESS-559: Skip extracting with GNU tar 1.28

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../commons/compress/archivers/tar/SparseFilesTest.java    | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)


[commons-compress] 02/02: COMPRESS-559: Skip extracting with GNU tar 1.28

Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

peterlee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git

commit d98e849850a33c1762d318108cb21d8e210388fc
Author: theobisproject <th...@gmail.com>
AuthorDate: Tue Dec 8 20:49:11 2020 +0100

    COMPRESS-559: Skip extracting with GNU tar 1.28
    
    It is known to be broken for the archive the test will extract
---
 .../apache/commons/compress/archivers/tar/SparseFilesTest.java | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/test/java/org/apache/commons/compress/archivers/tar/SparseFilesTest.java b/src/test/java/org/apache/commons/compress/archivers/tar/SparseFilesTest.java
index fad2fc8..ab41002 100644
--- a/src/test/java/org/apache/commons/compress/archivers/tar/SparseFilesTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/tar/SparseFilesTest.java
@@ -178,6 +178,8 @@ public class SparseFilesTest extends AbstractTestCase {
     @Test
     public void testExtractPaxGNU() throws IOException, InterruptedException {
         assumeFalse("This test should be ignored on Windows", isOnWindows);
+        assumeFalse("This test should be ignored if GNU tar is version 1.28",
+                getTarBinaryHelp().startsWith("tar (GNU tar) 1.28"));
 
         final File file = getFile("pax_gnu_sparse.tar");
         try (TarArchiveInputStream tin = new TarArchiveInputStream(new FileInputStream(file))) {
@@ -241,5 +243,13 @@ public class SparseFilesTest extends AbstractTestCase {
         fail("didn't find " + sparseFileName + " after extracting " + tarFile);
         return null;
     }
+
+    private String getTarBinaryHelp() throws IOException {
+        final ProcessBuilder pb = new ProcessBuilder("tar", "--version");
+        pb.redirectErrorStream(true);
+        final Process process = pb.start();
+        // wait until the help is shown
+        return new String(IOUtils.toByteArray(process.getInputStream()));
+    }
 }
 


[commons-compress] 01/02: COMPRESS-559: Extract sparsefile-0.1 also on Linux

Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

peterlee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git

commit 75a16c23c73010988dc6dad08397ab4cc51e3533
Author: theobisproject <th...@gmail.com>
AuthorDate: Sun Nov 22 13:58:56 2020 +0100

    COMPRESS-559: Extract sparsefile-0.1 also on Linux
---
 .../org/apache/commons/compress/archivers/tar/SparseFilesTest.java    | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/test/java/org/apache/commons/compress/archivers/tar/SparseFilesTest.java b/src/test/java/org/apache/commons/compress/archivers/tar/SparseFilesTest.java
index 3b76696..fad2fc8 100644
--- a/src/test/java/org/apache/commons/compress/archivers/tar/SparseFilesTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/tar/SparseFilesTest.java
@@ -189,11 +189,9 @@ public class SparseFilesTest extends AbstractTestCase {
                         IOUtils.toByteArray(sparseFileInputStream));
             }
 
-            // TODO : it's wired that I can only get a 0 size sparsefile-0.1 on my Ubuntu 16.04
-            //        using "tar -xf pax_gnu_sparse.tar"
             paxGNUEntry = tin.getNextTarEntry();
             assertTrue(tin.canReadEntryData(paxGNUEntry));
-            try (InputStream sparseFileInputStream = extractTarAndGetInputStream(file, "sparsefile-0.0")) {
+            try (InputStream sparseFileInputStream = extractTarAndGetInputStream(file, "sparsefile-0.1")) {
                 assertArrayEquals(IOUtils.toByteArray(tin),
                         IOUtils.toByteArray(sparseFileInputStream));
             }