Browse Source

Add destfile attribute to patch.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274783 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 22 years ago
parent
commit
2a0dc6e022
3 changed files with 24 additions and 2 deletions
  1. +3
    -0
      WHATSNEW
  2. +7
    -1
      docs/manual/CoreTasks/patch.html
  3. +14
    -1
      src/main/org/apache/tools/ant/taskdefs/Patch.java

+ 3
- 0
WHATSNEW View File

@@ -467,6 +467,9 @@ Other changes:
enable it to expand archives created with filenames using an encoding
other than UTF8. Bugzilla Report 10504.

* <patch> has a new attribute destfile that can be used to create a new
file instead of patching files in place.

Changes from Ant 1.5.2 to Ant 1.5.3
===================================



+ 7
- 1
docs/manual/CoreTasks/patch.html View File

@@ -29,6 +29,12 @@
<td align="center" valign="top">No, tries to guess it from the diff
file</td>
</tr>
<tr>
<td valign="top">destfile</td>
<td valign="top">the file to send the output to instead of
patching the file(s) in place. <em>since Ant 1.6</em></td>
<td align="center" valign="top">No.</td>
</tr>
<tr>
<td valign="top">backups</td>
<td valign="top">Keep backups of the unpatched files</td>
@@ -75,7 +81,7 @@ the diff output looked like</p>
</pre>
the leading <i>a/</i> will be stripped.
<hr>
<p align="center">Copyright &copy; 2000-2002 Apache Software Foundation. All rights
<p align="center">Copyright &copy; 2000-2003 Apache Software Foundation. All rights
Reserved.</p>

</body>


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

@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000,2002 The Apache Software Foundation. All rights
* Copyright (c) 2000,2002-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -85,6 +85,19 @@ public class Patch extends Task {
originalFile = file;
}

/**
* The name of a file to send the output to, instead of patching
* the file(s) in place; optional.
*
* @since Ant 1.6
*/
public void setDestfile(File file) {
if (file != null) {
cmd.createArgument().setValue("-o");
cmd.createArgument().setFile(file);
}
}

/**
* The file containing the diff output; required.
*/


Loading…
Cancel
Save