Browse Source

Make sure the dest attribute gets reset at the end of execute in

<bunzip2> and <gunzip> (bug 7552 audit).

Fix documentation for <gzip> and <bzip2> - these tasks perform
dependency checks.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272343 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 23 years ago
parent
commit
7c24f9164c
5 changed files with 19 additions and 6 deletions
  1. +3
    -3
      docs/manual/CoreTasks/pack.html
  2. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/BUnzip2.java
  3. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/BZip2.java
  4. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/Pack.java
  5. +10
    -3
      src/main/org/apache/tools/ant/taskdefs/Unpack.java

+ 3
- 3
docs/manual/CoreTasks/pack.html View File

@@ -10,8 +10,8 @@
<h2><a name="pack">GZip/BZip2</a></h2> <h2><a name="pack">GZip/BZip2</a></h2>
<h3>Description</h3> <h3>Description</h3>
<p>Packs a file using the GZip or BZip2 algorithm. <p>Packs a file using the GZip or BZip2 algorithm.
These tasks do not do any dependency checking; the output file is
always generated</p>
The output file is only generated if it doesn't exist or the source
file is newer.</p>
<h3>Parameters</h3> <h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0"> <table border="1" cellpadding="2" cellspacing="0">
<tr> <tr>
@@ -40,7 +40,7 @@ always generated</p>
/&gt;</code></p> /&gt;</code></p>
</blockquote> </blockquote>
<hr> <hr>
<p align="center">Copyright &copy; 2001 Apache Software Foundation. All rights
<p align="center">Copyright &copy; 2001-2002 Apache Software Foundation. All rights
Reserved.</p> Reserved.</p>


</body> </body>


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

@@ -69,6 +69,8 @@ import org.apache.tools.bzip2.CBZip2InputStream;
* *
* @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a> * @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a>
* *
* @since Ant 1.5
*
* @ant.task category="packaging" * @ant.task category="packaging"
*/ */




+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/BZip2.java View File

@@ -67,6 +67,8 @@ import org.apache.tools.bzip2.CBZip2OutputStream;
* *
* @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a> * @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a>
* *
* @since Ant 1.5
*
* @ant.task category="packaging" * @ant.task category="packaging"
*/ */




+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/Pack.java View File

@@ -67,6 +67,8 @@ import org.apache.tools.ant.Task;
* Abstract Base class for pack tasks. * Abstract Base class for pack tasks.
* *
* @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a> * @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a>
*
* @since Ant 1.5
*/ */


public abstract class Pack extends Task { public abstract class Pack extends Task {


+ 10
- 3
src/main/org/apache/tools/ant/taskdefs/Unpack.java View File

@@ -1,7 +1,7 @@
/* /*
* The Apache Software License, Version 1.1 * The Apache Software License, Version 1.1
* *
* Copyright (c) 2001 The Apache Software Foundation. All rights
* Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved. * reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -63,6 +63,8 @@ import org.apache.tools.ant.Task;
* Abstract Base class for unpack tasks. * Abstract Base class for unpack tasks.
* *
* @author <a href="mailto:umagesh@apache.org">Magesh Umasankar</a> * @author <a href="mailto:umagesh@apache.org">Magesh Umasankar</a>
*
* @since 1.5
*/ */


public abstract class Unpack extends Task { public abstract class Unpack extends Task {
@@ -139,8 +141,13 @@ public abstract class Unpack extends Task {
} }


public void execute() throws BuildException { public void execute() throws BuildException {
validate();
extract();
File savedDest = dest; // may be altered in validate
try {
validate();
extract();
} finally {
dest = savedDest;
}
} }


protected abstract String getDefaultExtension(); protected abstract String getDefaultExtension();


Loading…
Cancel
Save