Browse Source

Properly expand bzip2 files with multiple streams in <bunzip2>

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1350883 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 13 years ago
parent
commit
b817fdb2b8
5 changed files with 33 additions and 1 deletions
  1. +3
    -0
      WHATSNEW
  2. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/BUnzip2.java
  3. +28
    -0
      src/tests/antunit/taskdefs/bunzip2-test.xml
  4. +1
    -0
      src/tests/antunit/taskdefs/bzip2/expected
  5. BIN
      src/tests/antunit/taskdefs/bzip2/multiple.bz2

+ 3
- 0
WHATSNEW View File

@@ -55,6 +55,9 @@ Other changes:
* merged the BZIP2 package from Commons Compress, it can now
optionally read files that contain multiple streams properly.

* <bunzip2> will now properly expand files created by pbzip2 and
similar tools that create files with multiple bzip2 streams.

Changes from Ant 1.8.3 TO Ant 1.8.4
===================================



+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/BUnzip2.java View File

@@ -75,7 +75,7 @@ public class BUnzip2 extends Unpack {
if (b != 'Z') {
throw new BuildException("Invalid bz2 file.", getLocation());
}
zIn = new CBZip2InputStream(bis);
zIn = new CBZip2InputStream(bis, true);
byte[] buffer = new byte[BUFFER_SIZE];
int count = 0;
do {


+ 28
- 0
src/tests/antunit/taskdefs/bunzip2-test.xml View File

@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project default="antunit" xmlns:au="antlib:org.apache.ant.antunit">
<import file="../antunit-base.xml" />

<target name="testExpandArchiveWithMultipleStreams">
<mkdir dir="${output}"/>
<bunzip2 src="bzip2/multiple.bz2" dest="${output}"/>
<au:assertFilesMatch expected="bzip2/expected"
actual="${output}/multiple"/>
</target>

</project>

+ 1
- 0
src/tests/antunit/taskdefs/bzip2/expected View File

@@ -0,0 +1 @@
ab

BIN
src/tests/antunit/taskdefs/bzip2/multiple.bz2 View File


Loading…
Cancel
Save